fix(#464): enable anonymous batch commit tests by fixing compile errors #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Mutation Testing | |
| # Mutation testing in CI/CD (#556, builds on #378). | |
| # | |
| # cargo-mutants injects small changes ("mutants") into the contracts and | |
| # checks the test suite catches them. Configuration is in .cargo-mutants.toml. | |
| # | |
| # Two modes: | |
| # * Pull requests — fast, only mutates lines changed in the PR diff. | |
| # * Schedule/manual — full run over both contracts, uploaded as an artifact. | |
| on: | |
| pull_request: | |
| schedule: | |
| # Weekly full sweep. | |
| - cron: '0 4 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: mutation-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| mutants: | |
| name: cargo-mutants | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Need the base ref to compute the PR diff for incremental runs. | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-mutants-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Install cargo-mutants | |
| run: cargo install cargo-mutants --locked | |
| # Incremental run on PRs: only mutate lines touched by this PR. | |
| - name: Mutation test (PR diff) | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git diff origin/${{ github.base_ref }}..HEAD > pr.diff | |
| cargo mutants --no-shuffle -p ip_registry -p atomic_swap \ | |
| --in-diff pr.diff | |
| # Full run on schedule / manual dispatch. | |
| - name: Mutation test (full) | |
| if: github.event_name != 'pull_request' | |
| run: cargo mutants --no-shuffle -p ip_registry -p atomic_swap | |
| - name: Upload mutation report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: mutants-report | |
| path: mutants.out/ | |
| if-no-files-found: ignore |