diff --git a/.cargo/mutants.toml b/.cargo/mutants.toml new file mode 100644 index 000000000..485cf6c01 --- /dev/null +++ b/.cargo/mutants.toml @@ -0,0 +1,15 @@ +additional_cargo_args = ["--all-features"] +examine_globs = ["payjoin/src/uri/*.rs"] +exclude_globs = [] +exclude_re = [ + "impl Debug", + "impl Display", + "deserialize", + "Iterator", + ".*Error", + + # ---------------------Crate-specific exculsions--------------------- + # Receive + # src/receive/v1/mod.rs + "interleave_shuffle", # Replacing index += 1 with index *= 1 in a loop causes a timeout due to an infinite loop +] diff --git a/.github/workflows/cron-weekly-mutants.yml b/.github/workflows/cron-weekly-mutants.yml new file mode 100644 index 000000000..fe86cdb24 --- /dev/null +++ b/.github/workflows/cron-weekly-mutants.yml @@ -0,0 +1,39 @@ +name: Weekly cargo-mutants +on: + schedule: + - cron: "0 0 * * 0" # runs weekly on Sunday at 00:00 + workflow_dispatch: # allows manual triggering +jobs: + cargo-mutants: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: cargo-mutants + - run: cargo mutants --in-place --no-shuffle + - uses: actions/upload-artifact@v4 + if: always() + with: + name: mutants.out + path: mutants.out + - name: Check for new mutants + if: always() + run: | + if [ -s mutants.out/missed.txt ]; then + echo "New missed mutants found" + gh issue create \ + --title "New Mutants Found" \ + --body "$(cat <> $GITHUB_ENV + else + echo "No new mutants found" + echo "create_issue=false" >> $GITHUB_ENV + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index aceb1728b..995966bd6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ target *payjoin.sled Cargo.lock .vscode +mutants.out