Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Deployer/testing shell script #2

Deployer/testing shell script

Deployer/testing shell script #2

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