Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/mutants.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cargo-mutants configuration (GH-1).
# Kani harnesses are compiled only under `cargo kani` (cfg(kani)); mutating
# them under `cargo test` changes nothing and would be reported as missed.
exclude_globs = ["src/kani_harnesses.rs"]
39 changes: 32 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
gate:
name: Test + Lint
name: gate # the org ruleset requires a check named `gate`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -62,6 +62,7 @@ jobs:
name: Kani BMC
runs-on: ubuntu-latest
needs: gate
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -77,21 +78,36 @@ jobs:
cargo kani --harness verify_transpose_involution
cargo kani --harness verify_variance_non_negative
cargo kani --harness verify_correlation_bounded
cargo kani --harness verify_quicksort_sorted
cargo kani --harness verify_quicksort_length

# PRs: every mutant on a changed line must be caught (blocking).
# main: full sweep, advisory until the pre-existing missed-mutant backlog
# (114 in src/; see docs/ontology-conformance.md) is killed.
mutants:
name: Mutation Testing
runs-on: ubuntu-latest
needs: gate
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install cargo-mutants
run: cargo install cargo-mutants
run: cargo install --locked cargo-mutants

- name: Run mutation testing
- name: Mutants on the PR diff
if: github.event_name == 'pull_request'
run: |
git diff "origin/${{ github.base_ref }}...HEAD" > pr.diff
cargo mutants --no-shuffle -j4 --in-diff pr.diff -- --lib

- name: Full mutation sweep (advisory)
if: github.event_name != 'pull_request'
continue-on-error: true
run: cargo mutants --no-shuffle -j4 -- --lib

examples:
Expand Down Expand Up @@ -120,8 +136,12 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install pv
run: cargo install provable-contracts-cli --version 0.3.1
- name: Install pv (aprender-contracts-cli at the pinned aprender rev)
run: |
rev=$(sed -n 's/^aprender = .*rev = "\([0-9a-f]*\)".*/\1/p' Cargo.toml)
test -n "$rev"
cargo install --locked --git https://github.com/paiml/aprender --rev "$rev" aprender-contracts-cli
pv --version

- name: Validate contracts
run: |
Expand All @@ -133,10 +153,13 @@ jobs:
- name: Score contracts
run: pv score contracts/ --binding contracts/binding.yaml

# Advisory until the repo-governance findings (branch protection, deny.toml,
# roadmap/spec schema) are closed; see docs/ontology-conformance.md.
comply:
name: PMAT Comply
name: PMAT Comply (advisory)
runs-on: ubuntu-latest
needs: gate
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -147,7 +170,9 @@ jobs:
- name: Install pmat + pv
run: |
cargo install pmat
cargo install provable-contracts-cli --version 0.3.1
rev=$(sed -n 's/^aprender = .*rev = "\([0-9a-f]*\)".*/\1/p' Cargo.toml)
test -n "$rev"
cargo install --locked --git https://github.com/paiml/aprender --rev "$rev" aprender-contracts-cli

- name: Run pmat comply check
run: pmat comply check
Loading
Loading