-
Notifications
You must be signed in to change notification settings - Fork 40
94 lines (84 loc) · 3.04 KB
/
mutation-testing.yml
File metadata and controls
94 lines (84 loc) · 3.04 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Mutation Testing
# Minimal permissions for security
permissions:
contents: read
on:
# Run weekly on Sundays at 2 AM UTC
schedule:
- cron: "0 2 * * 0"
# Allow manual triggering
workflow_dispatch:
inputs:
package:
description: "Package to test (select 'all' for all packages)"
required: false
default: "all"
type: choice
options:
- all
- ml-kem
- module-lattice
- dhkem
#- frodo-kem
- x-wing
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Only run one mutation test at a time
concurrency:
group: mutation-testing
cancel-in-progress: false
jobs:
mutants:
name: ${{ matrix.package }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- ml-kem
- module-lattice
- dhkem
#- frodo-kem
- x-wing
# Only filter if a specific package was requested via workflow_dispatch
# For push/pull_request events, inputs.package is undefined, so default to 'all'
exclude:
- package: ${{ (github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'ml-kem' && 'ml-kem' || 'NONE' }}
- package: ${{ (github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'module-lattice' && 'module-lattice' || 'NONE' }}
- package: ${{ (github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'dhkem' && 'dhkem' || 'NONE' }}
#- package: ${{ (github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'frodo-kem' && 'frodo-kem' || 'NONE' }}
- package: ${{ (github.event.inputs.package || 'all') != 'all' && (github.event.inputs.package || 'all') != 'x-wing' && 'x-wing' || 'NONE' }}
steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
with:
persist-credentials: false
submodules: recursive
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: mutants-${{ matrix.package }}
- name: Install cargo-mutants
run: cargo install cargo-mutants@26.1.2 --locked
- name: Run mutation testing
run: |
cargo mutants --package "${{ matrix.package }}" --all-features -j 2 --timeout 300 2>&1 | tee mutants-output.txt
# Extract summary for job summary
{
echo "## Mutation Testing Results: ${{ matrix.package }}"
echo ""
echo '```'
tail -5 mutants-output.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload mutation results
uses: actions/upload-artifact@v7
if: always()
with:
name: mutants-${{ matrix.package }}
path: |
mutants.out/
mutants-output.txt
retention-days: 30