|
11 | 11 | # test — `cargo nextest run` on Linux / macOS / Windows. Crash tests |
12 | 12 | # are serialised by `.config/nextest.toml`, which `cargo test` |
13 | 13 | # ignores — that is why this workflow always uses nextest. |
| 14 | +# invariants — the same suite with PAGEDB_INVARIANT_CHECKS set, so the |
| 15 | +# opt-in commit-time structural checks are actually exercised. |
14 | 16 | # cross — `cargo check` across every Tier-1/Tier-2 target the VFS |
15 | 17 | # backend matrix in resource/architecture.md §8 covers, so a |
16 | 18 | # platform-specific backend never regresses unnoticed. |
@@ -122,6 +124,50 @@ jobs: |
122 | 124 | path: target/nextest/default/junit.xml |
123 | 125 | if-no-files-found: ignore |
124 | 126 |
|
| 127 | + # ───────────────────────────────────────────────────────────────────────── |
| 128 | + # The commit-time freed-page / reachability invariant is opt-in: with |
| 129 | + # PAGEDB_INVARIANT_CHECKS unset, `WriteTxn::commit` probes the variable once |
| 130 | + # and does nothing else, so the `test` job above never runs a single line of |
| 131 | + # it. Without this lane a regression in the check — or a healthy commit that |
| 132 | + # it starts rejecting — is invisible until someone enables it by hand. |
| 133 | + # |
| 134 | + # Linux-only and single-config on purpose: the check is pure page-graph |
| 135 | + # traversal with no platform-specific or feature-gated code, so a second |
| 136 | + # runner would buy nothing. It is deliberately expensive (it walks the data, |
| 137 | + # catalog, and commit-history trees on every commit), which is why it stays |
| 138 | + # opt-in rather than becoming the default for the whole matrix. |
| 139 | + invariants: |
| 140 | + name: Invariant checks |
| 141 | + runs-on: ubuntu-latest |
| 142 | + env: |
| 143 | + # Only presence is checked, never the value. |
| 144 | + PAGEDB_INVARIANT_CHECKS: "1" |
| 145 | + steps: |
| 146 | + - uses: actions/checkout@v7 |
| 147 | + |
| 148 | + - name: Install Rust |
| 149 | + uses: dtolnay/rust-toolchain@stable |
| 150 | + |
| 151 | + - uses: Swatinem/rust-cache@v2 |
| 152 | + with: |
| 153 | + prefix-key: invariants |
| 154 | + |
| 155 | + - name: Install cargo-nextest |
| 156 | + uses: taiki-e/install-action@v2 |
| 157 | + with: |
| 158 | + tool: nextest |
| 159 | + |
| 160 | + - name: Run tests with commit invariants enabled |
| 161 | + run: cargo nextest run -p pagedb --all-features --no-fail-fast |
| 162 | + |
| 163 | + - name: Upload nextest report |
| 164 | + if: always() |
| 165 | + uses: actions/upload-artifact@v7 |
| 166 | + with: |
| 167 | + name: nextest-invariants |
| 168 | + path: target/nextest/default/junit.xml |
| 169 | + if-no-files-found: ignore |
| 170 | + |
125 | 171 | # ───────────────────────────────────────────────────────────────────────── |
126 | 172 | # Per-platform VFS backends (architecture.md §8) must each at least |
127 | 173 | # type-check on every target they exist for. Compile-only — running on |
|
0 commit comments