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
# Example of how to configure a GitHub Actions workflow to run `cargo mutants`
# on every push to main and every pull request that changes the code.
# You could run this standalone or merge it into a workflow that runs other tests.
name: cargo-mutants
env:
CARGO_TERM_COLOR: always
on:
push:
branches:
- main
pull_request:
# Only test PR if it changes something that's likely to affect the results, because
# mutant tests can take a long time. Adjust these paths to suit your project.
paths:
- ".cargo/mutants.toml"
- ".github/workflows/tests.yml"
- "Cargo.*"
- "src/**"
- "testdata/**"
- "tests/**"
jobs:
cargo-mutants:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-mutants
- run: cargo mutants -vV --in-place
- uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-out
path: mutants.out