Skip to content

Commit

Permalink
Run mutants in CI after other tests pass (#147)
Browse files Browse the repository at this point in the history
- Fold MSRV into a single matrix and test nightly
- Run tests on every push
- Install rustfmt
- Run cargo-mutants only after tests pass
- Don't need to test install in each test
- Use rust-toolchain for mutants too
  • Loading branch information
sourcefrog authored Sep 14, 2023
2 parents 993082c + 64839f9 commit ca2ee6f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 84 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/msrv.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/mutate-self.yaml

This file was deleted.

33 changes: 26 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ name: Tests
permissions:
contents: read

on:
push:
branches:
- main
pull_request:
on: push

# see https://matklad.github.io/2021/09/04/fast-rust-builds.html
env:
Expand All @@ -25,11 +21,16 @@ jobs:
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
version: [stable, nightly, "1.70"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.version }}
components: rustfmt
- name: Show Cargo and rustc version
run: |
cargo --version
Expand All @@ -41,5 +42,23 @@ jobs:
run: cargo build --all-targets
- name: Test
run: cargo test --workspace
- name: Install
run: cargo install --path .

cargo-mutants:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: beta
- uses: Swatinem/rust-cache@v2
- run: cargo install --path .
- name: Mutants
run: |
cargo mutants --no-shuffle --exclude console.rs -j 2
- name: Archive mutants.out
uses: actions/upload-artifact@v3
if: always()
with:
name: mutants.out
path: mutants.out

0 comments on commit ca2ee6f

Please sign in to comment.