Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

Keep the build cache when a job fails (#188)

Fabio Rovai1e9381f91687
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96da4f45..660c9f75 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,6 +35,15 @@ jobs:
with:
components: clippy
- uses: Swatinem/rust-cache@v2
+ with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
- name: Build
run: cargo build
- name: Test
@@ -193,6 +202,14 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
# Keyed per leg: they build disjoint dependency trees, and sharing one
# cache between them would thrash it on every run. Not `matrix.name` —
# GitHub rejects cache keys containing commas, and the rejection is a
@@ -237,6 +254,15 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
+ with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
- uses: actions/setup-python@v5
with:
python-version: '3.11'
@@ -306,6 +332,15 @@ jobs:
use-github-cache: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
+ with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
# --release, not debug: tools/horn_differential.py looks for
# target/release/open-ontologies and falls back only to PATH.
- name: Build the Rust engine the differential compares against
@@ -397,6 +432,15 @@ jobs:
use-github-cache: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
+ with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
- name: Certify every shipped ontology through the proved checker
run: OO_REQUIRE_FIXTURES=1 cargo test --test lean_certificate_test -- --nocapture
- name: Check the verified SHACL Core evaluator against the W3C suite
@@ -691,6 +735,15 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
+ with:
+ # Save the build cache even when the job fails. The default discards
+ # it, and these jobs fail most often on a lint or a single test leg
+ # that runs AFTER everything is compiled, so the default threw away
+ # the expensive half of the work and made every fix-and-retry pay for
+ # it again. Measured on 18 September 2026: two branches failed clippy
+ # after a full build, and the lean job rebuilt a release binary from
+ # cold for twelve minutes on a rerun that changed one line.
+ cache-on-failure: true
- name: Run the suite and hold the ratchet
run: |
set -o pipefail