diff --git a/.github/actions/rust/action.yml b/.github/actions/rust/action.yml index dce4923678..bfb09d332d 100644 --- a/.github/actions/rust/action.yml +++ b/.github/actions/rust/action.yml @@ -30,7 +30,7 @@ runs: - name: Install Rust tools shell: bash - run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack + run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack cargo-mutants # sccache slows CI down, so we leave it disabled. # Leaving the steps below commented out, so we can re-evaluate enabling it later. diff --git a/.github/workflows/mutants.yml b/.github/workflows/mutants.yml new file mode 100644 index 0000000000..9414cdb77d --- /dev/null +++ b/.github/workflows/mutants.yml @@ -0,0 +1,36 @@ +name: Find mutants +on: + pull_request: + branches: ["main"] + paths: [".github/**"] + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + incremental-mutants: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + + - name: Relative diff + run: git diff origin/${{ github.base_ref }}.. | tee git.diff + + - name: Install Rust + uses: ./.github/actions/rust + with: + version: stable + components: rustfmt, clippy, llvm-tools-preview + + - name: Mutants + run: cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff + + - name: Archive mutants.out + uses: actions/upload-artifact@v3 + if: always() + with: + name: mutants-incremental.out + path: mutants.out