diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ee4105a..24567d39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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] @@ -68,6 +106,7 @@ jobs: run: cargo test --workspace minimal-versions: + needs: [quick-test] strategy: matrix: os: [macOS-latest, ubuntu-latest, windows-latest] @@ -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] @@ -102,6 +142,7 @@ jobs: - run: cargo test tests-from-tarball: + needs: [quick-test] strategy: matrix: os: [ubuntu-latest] @@ -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] @@ -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] @@ -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: @@ -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,