]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Introduce basic incremental mutation testing
authorDuncan Dean <git@dunxen.dev>
Thu, 30 Nov 2023 11:31:24 +0000 (13:31 +0200)
committerDuncan Dean <git@dunxen.dev>
Sun, 30 Jun 2024 15:25:56 +0000 (17:25 +0200)
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.

.github/workflows/build.yml

index 1a7c7f85cca0b54964a9bfd28110185547df80d7..90ecd4431c7aac8cfad73f5d18d39bc5822473df 100644 (file)
@@ -247,3 +247,19 @@ jobs:
           rustup component add rustfmt
       - name: Run rustfmt checks
         run: ci/rustfmt.sh
+
+  incremental-mutants:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+      - name: Relative diff
+        run: |
+          git branch -av
+          git diff origin/main.. | tee git.diff
+      - uses: Swatinem/rust-cache@v2
+      - name: Mutants
+        run: |
+          cargo install cargo-mutants
+          cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff