Skip to content

Commit

Permalink
ci: Start mutants as soon as Linux build succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Nov 20, 2024
1 parent 7806cf6 commit e40b205
Showing 1 changed file with 45 additions and 22 deletions.
67 changes: 45 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,45 @@ env:
CARGO_MUTANTS_MINIMUM_TEST_TIMEOUT: 60

jobs:
# Before anything else, run a quick test on just stable: this is significantly
# faster than Windows or macOS and should catch most issues, and lets us get
# started on the longer-running mutants and other tests.
#
# Also, build a Linux binary that we can use for the later mutants runs.
quick-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: beta
- uses: Swatinem/rust-cache@v2
- name: Show Cargo and rustc version
run: |
cargo --version
rustc --version
# TODO: Maybe also check clippy and rustfmt here.
- name: Build
run: cargo build --all-targets
- uses: taiki-e/install-action@v2
name: Install nextest using install-action
with:
tool: nextest
- name: Test
run: cargo test --workspace
- name: Build release binary
run: cargo build --release
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: cargo-mutants-linux
path: |
target/release/cargo-mutants
test:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand Down Expand Up @@ -68,6 +106,7 @@ jobs:
run: cargo test --workspace

minimal-versions:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand All @@ -86,6 +125,7 @@ jobs:

# Run `cargo update` and check the tests still pass
maximal-versions:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand All @@ -102,6 +142,7 @@ jobs:
- run: cargo test

tests-from-tarball:
needs: [quick-test]
strategy:
matrix:
os: [ubuntu-latest]
Expand Down Expand Up @@ -136,6 +177,7 @@ jobs:
# their MSRV, and on every platform because there are platform-specific
# dependencies.
install:
needs: [quick-test]
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
Expand All @@ -154,29 +196,10 @@ jobs:
- run: cargo install --locked --path .
- run: cargo install --path .

release-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: beta
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: cargo-mutants-linux
path: |
target/release/cargo-mutants
pr-mutants:
runs-on: ubuntu-latest
needs: [release-binary]
if: github.event_name == 'pull_request'
needs: [quick-test]
strategy:
matrix:
test_tool: [cargo, nextest]
Expand Down Expand Up @@ -217,7 +240,7 @@ jobs:

cargo-mutants:
runs-on: ubuntu-latest
needs: [test, release-binary]
needs: [quick-test]
strategy:
fail-fast: false # We want to get all the mutant failures
matrix:
Expand Down Expand Up @@ -266,12 +289,12 @@ jobs:
overall-result:
needs:
[
quick-test,
test,
minimal-versions,
maximal-versions,
tests-from-tarball,
install,
release-binary,
pr-mutants,
cargo-mutants,
typos,
Expand Down

0 comments on commit e40b205

Please sign in to comment.