Skip to content

Commit

Permalink
CI: Merge run_tests and release jobs to try to improve CI times
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Aug 14, 2024
1 parent 96dfc83 commit 3f8f0e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 57 deletions.
64 changes: 7 additions & 57 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,58 +40,6 @@ jobs:
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings

run_tests:
name: Run tests ${{ matrix.builder.target }}
runs-on: ${{ matrix.builder.runner }}

strategy:
fail-fast: false
matrix:
builder: [
{
name: windows,
target: x86_64-pc-windows-gnu,
runner: windows-2019
},
{
name: windows,
target: x86_64-pc-windows-msvc,
runner: windows-2019
},
{
name: mac,
target: x86_64-apple-darwin,
runner: macos-12
},
{
name: mac,
target: aarch64-apple-darwin,
runner: macos-14 # ARM
},
{
name: linux,
target: x86_64-unknown-linux-musl,
runner: ubuntu-20.04
},
{
name: linux,
target: x86_64-unknown-linux-gnu,
runner: ubuntu-20.04
}
]

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.builder.target }}

- name: Run tests
run: cargo test --workspace --target ${{ matrix.builder.target }}

msrv:
runs-on: ubuntu-latest
steps:
Expand All @@ -105,10 +53,9 @@ jobs:
run: cargo hack check --rust-version --workspace --all-targets --ignore-private


release:
name: release artifact for ${{ matrix.builder.target }}
test_and_release:
name: Run tests and release artifact for ${{ matrix.builder.target }}
runs-on: ${{ matrix.builder.runner }}
needs: [run_tests, msrv]

strategy:
fail-fast: false
Expand Down Expand Up @@ -155,8 +102,11 @@ jobs:
with:
targets: ${{ matrix.builder.target }}

- name: Run tests
run: cargo test --workspace --target ${{ matrix.builder.target }}

- name: Build cli
run: cargo build --release --target ${{ matrix.builder.target }}
run: cargo build --release --bins --target ${{ matrix.builder.target }}

- name: Move files for packaging (unix)
if: matrix.builder.name == 'linux' || matrix.builder.name == 'mac'
Expand Down Expand Up @@ -195,7 +145,7 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
needs: [run_tests, msrv]
needs: [test_and_release, msrv]

steps:
- name: Checkout reposistory
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Github Actions:
- Change CI to run tests on all platforms we generate builds artifacts for.
- Use the ARM Mac Github runner to build and test the ARM Mac builds.
- Merge `run_tests` and `release` jobs to try to improve CI times.

## [0.2.5] - 2024-07-17

Expand Down

0 comments on commit 3f8f0e8

Please sign in to comment.