Skip to content

Commit

Permalink
ci: Do full mutants run twice a week
Browse files Browse the repository at this point in the history
And when dispatched manually.
  • Loading branch information
larseggert committed Mar 14, 2024
1 parent f408321 commit fea27f2
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/mutants.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
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-*"]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand All @@ -16,9 +20,6 @@ jobs:
with:
fetch-depth: 0

- name: Relative diff
run: git diff origin/${{ github.base_ref }}.. > pr.diff

- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -34,13 +35,26 @@ jobs:
with:
version: stable

- name: Mutants
- name: Find incremental mutants
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
run: |
# Don't fail the build if mutants fail, for now.
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 "### Mutants"
echo "### $TITLE"
echo "See https://mutants.rs/using-results.html for more information."
echo '```'
cat results.txt
Expand Down

0 comments on commit fea27f2

Please sign in to comment.