This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
forked from stacks-network/stacks-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fail workflow on missed/timeout mutations on pr (different work…
…flow)
- Loading branch information
Showing
3 changed files
with
45 additions
and
47 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tracking PR Mutants | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
# Mutants testing: Execute on PR on packages that have functions modified, and fail the workflow if there are missed or timeout mutations | ||
incremental-mutants: | ||
name: Incremental Mutants Testing | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Relative diff | ||
run: | | ||
git branch -av | ||
git diff origin/${{ github.base_ref }}.. | tee git.diff | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo install cargo-mutants | ||
- name: Mutants | ||
run: | | ||
cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff || true | ||
- name: Check if we have missed/timeout mutants, and if so, fail the workflow | ||
run: | | ||
if [ -s ./missed.txt ] || [ -s ./timeout.txt ]; then | ||
echo "Found timed out or missed mutants, aborting..." | ||
echo "missed.txt:" | ||
cat ./missed.txt | ||
echo "------------------" | ||
echo "timeout.txt:" | ||
cat ./timeout.txt | ||
exit 1; | ||
fi | ||
working-directory: ./mutants.out |