---
name: Mutants
"on":
schedule:
- cron: "0 3 * * 1" workflow_dispatch:
permissions:
contents: read
concurrency:
group: mutants-${{ github.workflow }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
CARGO_PROFILE_TEST_DEBUG: "0"
NEXTEST_PROFILE: mutants
RUSTC_WRAPPER: sccache
jobs:
mutants:
name: Mutation testing ${{ strategy.job-index }}
runs-on: ubuntu-latest
timeout-minutes: 355
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]
steps:
- uses: actions/checkout@v4
timeout-minutes: 3
- name: Cache cargo downloads
uses: actions/cache@v6
timeout-minutes: 3
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: dl-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
dl-${{ runner.os }}-
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 with:
toolchain: stable
timeout-minutes: 5
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad timeout-minutes: 5
- name: Install cargo-mutants and cargo-nextest
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 timeout-minutes: 5
with:
tool: cargo-mutants@27.1.0,cargo-nextest
- name: Run mutants
timeout-minutes: 340
run: >-
cargo mutants --workspace --jobs 2
--shard ${{ strategy.job-index }}/${{ strategy.job-total }}
- name: Upload mutation outcome
if: always()
uses: actions/upload-artifact@v4
timeout-minutes: 3
with:
name: mutants-shard-${{ strategy.job-index }}
path: mutants.out