fix: update register_all count to 29 #172
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| # ── Fast checks ─────────────────────────────────────────────────────── | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --workspace --all-targets -- -D warnings | |
| # ── Tests ───────────────────────────────────────────────────────────── | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Run tests (JUnit XML output) | |
| run: cargo nextest run --workspace --profile ci | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: target/nextest/ci/junit.xml | |
| if-no-files-found: ignore | |
| # ── Security audits ────────────────────────────────────────────────── | |
| audit: | |
| name: Security Audit (RustSec) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: rustsec/audit-check@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| deny: | |
| name: Cargo Deny | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| # ── Code coverage ──────────────────────────────────────────────────── | |
| coverage: | |
| name: Code Coverage | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: Generate coverage (LCOV + HTML) | |
| run: | | |
| cargo llvm-cov --workspace --lcov --output-path lcov.info | |
| cargo llvm-cov --workspace --html --output-dir coverage-html | |
| - name: Upload LCOV to Codecov | |
| if: env.CODECOV_TOKEN != '' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload HTML coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-html | |
| path: coverage-html/ | |
| # ── Miri (undefined behavior, pointer provenance) ─────────────────── | |
| miri: | |
| name: Miri | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: miri | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run Miri (instance model tests) | |
| # Filter to instance:: tests to avoid known rowan UB (rust-analyzer/rowan issue 192). | |
| # rowan's custom Arc implementation has a retag issue in HeaderSlice that | |
| # triggers Miri's borrow stack check. This is upstream, not our code. | |
| # Once rowan ships a fix, expand to full --lib. | |
| run: "cargo miri test -p spar-hir-def --lib -- instance::" | |
| env: | |
| MIRIFLAGS: "-Zmiri-strict-provenance -Zmiri-disable-isolation" | |
| # ── Property-based testing (extended) ─────────────────────────────── | |
| proptest: | |
| name: Proptest (extended) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run proptest with 10x cases | |
| run: cargo test --workspace | |
| env: | |
| PROPTEST_CASES: "1000" | |
| # ── Mutation testing ──────────────────────────────────────────────── | |
| mutants: | |
| name: Mutation Testing | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-mutants | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-mutants | |
| - name: Run cargo-mutants on spar-analysis | |
| run: cargo mutants -p spar-analysis --timeout 120 --jobs 4 --output mutants-out -- --lib || true | |
| - name: Check surviving mutants | |
| run: | | |
| MISSED=$(grep -c '^MISSED' mutants-out/caught.txt 2>/dev/null || echo 0) | |
| if [ -f mutants-out/missed.txt ]; then | |
| MISSED=$(wc -l < mutants-out/missed.txt | tr -d ' ') | |
| fi | |
| echo "Surviving mutants: $MISSED" | |
| # Ratchet gate: fail if more mutants survive than the threshold. | |
| # Lower this number as tests improve. Target: 0. | |
| MAX_MISSED=142 | |
| if [ "$MISSED" -gt "$MAX_MISSED" ]; then | |
| echo "::error::$MISSED mutant(s) survived (threshold: $MAX_MISSED) — add tests to kill them" | |
| cat mutants-out/missed.txt 2>/dev/null | head -30 | |
| exit 1 | |
| fi | |
| echo "Mutant survivors ($MISSED) within threshold ($MAX_MISSED). Target: 0." | |
| - name: Upload mutants report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mutants-report | |
| path: mutants-out/ | |
| # ── Supply chain verification ─────────────────────────────────────── | |
| supply-chain: | |
| name: Supply Chain (cargo-vet) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-vet | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-vet | |
| - name: Verify supply chain | |
| run: cargo vet --locked |