Repository navigation
59 lines (51 loc) · 1.89 KB
/
Copy pathmutation.yml
File metadata and controls
59 lines (51 loc) · 1.89 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
# Scheduled mutation-testing run.
#
# The shared CI gate runs the pass/fail unit suite, not Stryker: a mutation run
# is too slow to sit on every push, so it needs its own cadence rather than
# riding on push or pull_request. thresholds.break is null in the Stryker
# config, so a low score never fails this job; the artifact is what a human
# reads to judge whether coverage of src/XChainDecoder/** moved.
name: mutation
# Least privilege for the default GITHUB_TOKEN: every job here only reads the
# repo; uploading the report artifact needs no elevated scope.
permissions:
contents: read
on:
schedule:
# Sundays 09:00 UTC. Mutation runs are heavy; weekly keeps the cadence
# cheap while still catching drift within a week of it landing.
- cron: "0 9 * * 0"
# Re-run on demand, e.g. right after a change to src/XChainDecoder/**.
workflow_dispatch:
jobs:
mutation:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Stryker mutation testing
run: npm run test:mutation
# The html reporter always writes reports/mutation/index.html on a
# completed run; fail loudly here rather than let upload-artifact
# silently skip an empty directory, which would look green forever.
- name: Verify the report is nonempty
run: |
set -euo pipefail
if [ ! -s reports/mutation/index.html ]; then
echo "::error::reports/mutation/index.html is missing or empty"
exit 1
fi
- name: Archive mutation report
if: always()
uses: actions/upload-artifact@v4
with:
name: mutation-report
path: reports/mutation/
retention-days: 30