-
Notifications
You must be signed in to change notification settings - Fork 124
68 lines (59 loc) · 2.02 KB
/
mutants.yml
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
name: Find mutants
on:
schedule:
- cron: '42 3 * * 2,5' # Runs at 03:42 UTC (m and h chosen arbitrarily) twice a week.
workflow_dispatch:
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
mutants:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss
- name: Install Rust
uses: ./.github/actions/rust
with:
version: stable
- name: Find incremental mutants
if: github.event_name == 'pull_request'
run: |
git diff origin/${{ github.base_ref }}.. > pr.diff
set -o pipefail
cargo mutants --test-tool=nextest --no-shuffle -j 2 -vV --in-diff pr.diff | tee results.txt || true
echo 'TITLE=Incremental Mutants' >> "$GITHUB_ENV"
- name: Find mutants
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
set -o pipefail
cargo mutants --test-tool=nextest -vV --in-place | tee results.txt || true
echo 'TITLE=All Mutants' >> "$GITHUB_ENV"
- name: Post step summary
if: always()
run: |
{
echo "### $TITLE"
echo "See https://mutants.rs/using-results.html for more information."
echo '```'
sed 's/\x1b\[[0-9;]*[mGKHF]//g' results.txt
echo '```'
} > "$GITHUB_STEP_SUMMARY"
- name: Archive mutants.out
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants.out
path: mutants.out