Skip to content

Commit d191201

Browse files
authored
Merge pull request #601 from str4d/ci-mutants
CI: Add mutation testing workflow
2 parents c266bfa + 53accb7 commit d191201

File tree

3 files changed

+84
-11
lines changed

3 files changed

+84
-11
lines changed

.github/workflows/mutants.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Mutation testing
2+
3+
env:
4+
CARGO_TERM_COLOR: always
5+
6+
on:
7+
# Run weekly on Sundays at 2 AM UTC
8+
schedule:
9+
- cron: "0 2 * * 0"
10+
# Allow manual triggering
11+
workflow_dispatch:
12+
inputs:
13+
package:
14+
description: "Package to test (select 'all' for all packages)"
15+
required: false
16+
default: "all"
17+
type: choice
18+
options:
19+
- all
20+
- age
21+
- age-core
22+
- age-plugin
23+
- rage
24+
25+
permissions:
26+
contents: read
27+
28+
# Only run one mutation test at a time
29+
concurrency:
30+
group: mutation-testing
31+
cancel-in-progress: false
32+
33+
jobs:
34+
mutants:
35+
name: Mutation testing of ${{ matrix.package }}
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
package:
41+
- age
42+
- age-core
43+
- age-plugin
44+
- rage
45+
# Only filter if a specific package was requested via workflow_dispatch
46+
# For push/pull_request events, inputs.package is undefined, so default to 'all'
47+
exclude:
48+
- package: ${{ case((github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'age', 'age', 'NONE') }}
49+
- package: ${{ case((github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'age-core', 'age-core', 'NONE') }}
50+
- package: ${{ case((github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'age-plugin', 'age-plugin', 'NONE') }}
51+
- package: ${{ case((github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'rage', 'rage', 'NONE') }}
52+
53+
steps:
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
with:
56+
persist-credentials: false
57+
- uses: dtolnay/rust-toolchain@stable
58+
id: toolchain
59+
- run: rustup override set "${TOOLCHAIN}"
60+
shell: sh
61+
env:
62+
TOOLCHAIN: ${{steps.toolchain.outputs.name}}
63+
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
64+
with:
65+
tool: cargo-mutants
66+
- run: cargo mutants --package "${{ matrix.package }}" --all-features -vV --in-place
67+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
68+
if: always()
69+
with:
70+
name: mutants-${{ matrix.package }}
71+
path: |
72+
mutants.out/
73+
retention-days: 30

supply-chain/audits.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ who = "Jack Grigg <thestr4d@gmail.com>"
99
criteria = "safe-to-deploy"
1010
delta = "0.16.1 -> 0.16.0"
1111
notes = """
12-
Downgrade lowers MSRV. Change to `unsafe` code is to remove a `target_os = \"nto\"`
12+
Downgrade lowers MSRV. Change to `unsafe` code is to remove a `target_os = "nto"`
1313
specific handler, so this will fail to run on QNX due to missing `cfmakeraw`; on
1414
other platforms there is no change.
1515
"""

supply-chain/imports.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ delta = "0.3.27 -> 0.3.31"
508508
who = "Pat Hickey <pat@moreproductive.org>"
509509
criteria = "safe-to-deploy"
510510
delta = "0.3.27 -> 0.3.31"
511-
notes = "New waker_ref module contains \"FIXME: panics on Arc::clone / refcount changes could wreak havoc...\" comment, but this corner case feels low risk."
511+
notes = 'New waker_ref module contains "FIXME: panics on Arc::clone / refcount changes could wreak havoc..." comment, but this corner case feels low risk.'
512512

513513
[[audits.bytecode-alliance.audits.gimli]]
514514
who = "Alex Crichton <alex@alexcrichton.com>"
@@ -975,7 +975,7 @@ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_p
975975
who = "Lukasz Anforowicz <lukasza@chromium.org>"
976976
criteria = "safe-to-deploy"
977977
delta = "1.14.0 -> 1.15.0"
978-
notes = "The delta in `lib.rs` only tweaks doc comments and `#[cfg(feature = \"std\")]`."
978+
notes = 'The delta in `lib.rs` only tweaks doc comments and `#[cfg(feature = "std")]`.'
979979
aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
980980

981981
[[audits.google.audits.equivalent]]
@@ -1282,8 +1282,8 @@ who = "Lukasz Anforowicz <lukasza@chromium.org>"
12821282
criteria = "safe-to-deploy"
12831283
version = "1.0.78"
12841284
notes = """
1285-
Grepped for \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits
1286-
(except for a benign \"fs\" hit in a doc comment)
1285+
Grepped for "crypt", "cipher", "fs", "net" - there were no hits
1286+
(except for a benign "fs" hit in a doc comment)
12871287

12881288
Notes from the `unsafe` review can be found in https://crrev.com/c/5385745.
12891289
"""
@@ -1401,8 +1401,8 @@ who = "Lukasz Anforowicz <lukasza@chromium.org>"
14011401
criteria = "safe-to-deploy"
14021402
version = "1.0.35"
14031403
notes = """
1404-
Grepped for \"unsafe\", \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits
1405-
(except for benign \"net\" hit in tests and \"fs\" hit in README.md)
1404+
Grepped for "unsafe", "crypt", "cipher", "fs", "net" - there were no hits
1405+
(except for benign "net" hit in tests and "fs" hit in README.md)
14061406
"""
14071407
aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
14081408

@@ -1480,7 +1480,7 @@ and there were no hits except for:
14801480
* Using `unsafe` in a string:
14811481

14821482
```
1483-
src/constfn.rs: \"unsafe\" => Qualifiers::Unsafe,
1483+
src/constfn.rs: "unsafe" => Qualifiers::Unsafe,
14841484
```
14851485

14861486
* Using `std::fs` in `build/build.rs` to write `${OUT_DIR}/version.expr`
@@ -1668,7 +1668,7 @@ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_p
16681668
who = "Lukasz Anforowicz <lukasza@chromium.org>"
16691669
criteria = "safe-to-deploy"
16701670
version = "1.0.197"
1671-
notes = "Grepped for \"unsafe\", \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits"
1671+
notes = 'Grepped for "unsafe", "crypt", "cipher", "fs", "net" - there were no hits'
16721672
aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
16731673

16741674
[[audits.google.audits.serde_derive]]
@@ -1687,7 +1687,7 @@ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_p
16871687
who = "Lukasz Anforowicz <lukasza@chromium.org>"
16881688
criteria = "safe-to-deploy"
16891689
delta = "1.0.202 -> 1.0.203"
1690-
notes = "Grepped for \"unsafe\", \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits"
1690+
notes = 'Grepped for "unsafe", "crypt", "cipher", "fs", "net" - there were no hits'
16911691
aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
16921692

16931693
[[audits.google.audits.serde_derive]]
@@ -3630,7 +3630,7 @@ criteria = "safe-to-deploy"
36303630
delta = "0.2.0 -> 0.2.1"
36313631
notes = """
36323632
- Changes to `unsafe` code blocks are just formatting.
3633-
- Changes to `extern fn`s are to declare them explicitly as `extern \"C\" fn`s.
3633+
- Changes to `extern fn`s are to declare them explicitly as `extern "C" fn`s.
36343634
"""
36353635
aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml"
36363636

0 commit comments

Comments
 (0)