Skip to content

Commit 00c70eb

Browse files
committed
Introduce basic incremental mutation testing
We introduce a CI job for mutation testing of PR diffs using cargo-mutants. Missed cases do not trigger a fail of this job yet as we just introduce it now for visibility. We may start enforcing stricter rules at a later stage.
1 parent e0323ec commit 00c70eb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,26 @@ jobs:
216216
- name: Run default clippy linting
217217
run: |
218218
cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err
219+
220+
mutation:
221+
runs-on: ubuntu-latest
222+
if: github.event_name == 'pull_request'
223+
steps:
224+
- name: Checkout source code
225+
uses: actions/checkout@v3
226+
with:
227+
fetch-depth: 0
228+
- name: Relative diff
229+
run: |
230+
git branch -av
231+
git diff origin/${{ github.base_ref }}.. | tee git.diff
232+
- run: cargo install cargo-mutants
233+
- name: Mutants
234+
run: |
235+
cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff
236+
- name: Archive mutants.out
237+
uses: actions/upload-artifact@v3
238+
if: always()
239+
with:
240+
name: mutants-incremental.out
241+
path: mutants.out

0 commit comments

Comments
 (0)