From 8588e67a2c8817ee2a071aae30b446084dd36172 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 03:55:19 +0100 Subject: [PATCH 1/2] CI: rust-crates job, cargo test --locked for the three Rust crates on Rust-touching pull requests fmt and clippy run report-only: main has 746/659/279 fmt diffs and 31/54/16 clippy warnings. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/rust-crates.yml | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/rust-crates.yml diff --git a/.github/workflows/rust-crates.yml b/.github/workflows/rust-crates.yml new file mode 100644 index 00000000..4d3c4c6f --- /dev/null +++ b/.github/workflows/rust-crates.yml @@ -0,0 +1,77 @@ +name: Rust crates + +# The three Rust crates (cultcache-rs, cultnet-rs, cultmesh-rs) are separate +# cargo packages with their own lockfiles, chained by path dependencies. This job +# runs only when Rust or the vectors the Rust tests read change: the forge has one +# runner shared by every repository, so it is not a general push job. +on: + pull_request: + paths: + - "packages/cultcache-rs/**" + - "packages/cultnet-rs/**" + - "packages/cultmesh-rs/**" + - "tests/vectors/**" + - "contracts/cultnet/**" + - "contracts/cultmesh/**" + - ".github/workflows/rust-crates.yml" + workflow_dispatch: + +jobs: + rust: + name: cargo test, fmt, clippy + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + CARGO_TERM_COLOR: never + CARGO_INCREMENTAL: "0" + + steps: + - name: Check out CultLib + uses: actions/checkout@v4 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + # Restores when the runner serves a cache; a miss only costs the cold build. + - name: Cache cargo registry and build output + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + packages/cultcache-rs/target + packages/cultnet-rs/target + packages/cultmesh-rs/target + key: rust-crates-${{ runner.os }}-${{ hashFiles('packages/*-rs/Cargo.lock') }} + restore-keys: rust-crates-${{ runner.os }}- + + # Each crate's `cargo test` builds its path dependencies, so cultmesh-rs + # covers all three libraries; every crate is still run for its own tests. + - name: cargo test --locked + run: | + for crate in cultcache-rs cultnet-rs cultmesh-rs; do + echo "::group::$crate" + cargo test --locked --manifest-path "packages/$crate/Cargo.toml" + echo "::endgroup::" + done + + # fmt and clippy are reported, not gated: main is not clean for either + # (fmt: 746 / 659 / 279 diffs in cultcache-rs / cultnet-rs / cultmesh-rs; + # clippy 1.99 --all-targets: 31 / 54 / 16 warnings, no errors). A -D gate would be red on every + # pull request, and a count ratchet drifts whenever `stable` adds a lint. + # Make these blocking after the crates are formatted and clippy-clean. + - name: cargo fmt --check (report only) + continue-on-error: true + run: | + for crate in cultcache-rs cultnet-rs cultmesh-rs; do + cargo fmt --check --manifest-path "packages/$crate/Cargo.toml" + done + + - name: cargo clippy (report only) + continue-on-error: true + run: | + for crate in cultcache-rs cultnet-rs cultmesh-rs; do + cargo clippy --locked --all-targets --manifest-path "packages/$crate/Cargo.toml" + done -- 2.47.3 From efa568202b658c09b9b458bda39338ac548aed89 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 04:51:47 +0100 Subject: [PATCH 2/2] CI (Rust): run in the rust:1.95 image, no setup action or cache The first run failed before any step: the forge runner did not set up the toolchain through dtolnay/rust-toolchain, or did not serve actions/cache. quic-native's Linux build takes its toolchain from a container image; do the same. Timeout 30 for a cold build with no cache. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/rust-crates.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust-crates.yml b/.github/workflows/rust-crates.yml index 4d3c4c6f..baf69055 100644 --- a/.github/workflows/rust-crates.yml +++ b/.github/workflows/rust-crates.yml @@ -20,7 +20,13 @@ jobs: rust: name: cargo test, fmt, clippy runs-on: ubuntu-latest - timeout-minutes: 20 + # The toolchain comes from the image, as quic-native's Linux build does: the + # forge runner does not set up toolchains through marketplace actions, and no + # cache is assumed (the first run with a setup action and actions/cache + # failed before any step ran). 1.95 matches the Yggdrasil verify container. + container: + image: rust:1.95-bookworm + timeout-minutes: 30 env: CARGO_TERM_COLOR: never CARGO_INCREMENTAL: "0" @@ -29,23 +35,8 @@ jobs: - name: Check out CultLib uses: actions/checkout@v4 - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - with: - components: clippy, rustfmt - - # Restores when the runner serves a cache; a miss only costs the cold build. - - name: Cache cargo registry and build output - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - packages/cultcache-rs/target - packages/cultnet-rs/target - packages/cultmesh-rs/target - key: rust-crates-${{ runner.os }}-${{ hashFiles('packages/*-rs/Cargo.lock') }} - restore-keys: rust-crates-${{ runner.os }}- + - name: Add clippy and rustfmt + run: rustup component add clippy rustfmt && cargo --version # Each crate's `cargo test` builds its path dependencies, so cultmesh-rs # covers all three libraries; every crate is still run for its own tests. -- 2.47.3