Add in diff cargo-mutants CI workflow
What changed, and why it matters
This commit adds a new automated testing step to the project's GitHub Actions CI pipeline. It runs a tool called cargo-mutants on the code changed in a pull request to help detect whether tests are thorough enough. There is no change to the actual Bitcoin library code, no new feature, and no security fix or vulnerability.
No security action needed. This is a routine CI quality-assurance improvement. Reviewers may optionally confirm the pinned action hashes and that the cargo-mutants job has appropriate resource limits and timeout settings.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces a new GitHub Actions job named DiffMutants in .github/workflows/rust.yml. The job checks out the repository with full history, fetches the master branch, computes the diff between the current branch and origin/master, installs cargo-mutants, and runs cargo mutants –no-shuffle –in-diff git.diff. The README is updated to list the new CI job. This is purely a CI/testing infrastructure change.
Changed components
.github/workflows/rust.yml.github/workflows/README.mdInspect captured patch +24 / −3
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index 38a6340e..5bb18672 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -31,9 +31,10 @@ Run from rust.yml unless stated otherwise. Unfortunately we are now exceeding th
17. `API`
18. `Policy` - enforce repository coding policy.
19. `Re-exports`
-20. `release` - run by `release.yml`
-21. `labeler` - run by `manage-pr.yml`
-22. `Shellcheck` - run by `shellcheck.yml`
+20. `DiffMutants`
+21. `release` - run by `release.yml`
+22. `labeler` - run by `manage-pr.yml`
+23. `Shellcheck` - run by `shellcheck.yml`
If any change touches the `.github/` directory then the `zizmor`, run by `zizmor.yml`, will be
triggered for that PR.
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 1f72c50b..b6a9f5e6 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -443,3 +443,23 @@ jobs:
run: |
contrib/generate-primitives-re-export-test.sh && (cd ./primitives && cargo test --all-features)
contrib/generate-bitcoin-re-export-test.sh && (cd ./bitcoin && cargo test --all-features)
+
+ DiffMutants:
+ name: Check cargo mutants in diff - stable toolchain
+ runs-on: ubuntu-24.04
+ steps:
+ - name: "Checkout repo"
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ persist-credentials: false
+ fetch-depth: 0 # required for full diff context
+ - name: "Select toolchain"
+ uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
+ - name: "Fetch base branch for diff"
+ run: git fetch origin master
+ - name: "Retrieve relative diff"
+ run: git diff origin/master.. | tee git.diff
+ - uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
+ with:
+ tool: cargo-mutants
+ - run: cargo mutants --no-shuffle --in-diff git.diff
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.