Find mutants #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
permissions: | |
contents: read | |
jobs: | |
mutants: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Get minimum NSS version | |
id: nss-version | |
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT" | |
- name: Install NSS | |
uses: ./.github/actions/nss | |
with: | |
minimum-version: ${{ steps.nss-version.outputs.minimum }} | |
- name: Install Rust | |
uses: ./.github/actions/rust | |
with: | |
tools: cargo-mutants | |
- 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@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 | |
if: always() | |
with: | |
name: mutants.out | |
path: mutants.out |