Skip to content

Commit e5c7cfa

Browse files
ci: fix clippy cold-cache v8 link failure; trim release gate to tests
- ci.yml: build before clippy so the v8 crate fetches its prebuilt static lib (clippy runs in check mode and won't download it on a cold Actions cache; deps build with normal rustc, so clippy reuses the artifact) - release.yml: release gate runs only the tests (fmt/clippy are gated on main by ci.yml; tags are cut from main) - release.sh: order the local gate fmt -> test -> clippy so the test build fetches v8 before clippy runs on a cold tree
1 parent 99edd96 commit e5c7cfa

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v4
3636
- uses: Swatinem/rust-cache@v2
37+
# Build first so the `v8` crate fetches its prebuilt static lib. Clippy
38+
# runs in check mode, which doesn't trigger that download on a cold cache;
39+
# deps build with normal rustc (only workspace crates use clippy-driver),
40+
# so clippy then reuses the v8 artifact.
41+
- run: cargo build --workspace --all-features
3742
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
3843

3944
test:

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333
- uses: Swatinem/rust-cache@v2
34-
- name: Format
35-
run: cargo fmt --all --check
36-
- name: Clippy
37-
run: cargo clippy --workspace --all-targets --locked -- -D warnings
34+
# fmt/clippy are gated on main by ci.yml; the release only needs the tests
35+
# to pass before artifacts publish.
3836
- name: Tests
3937
run: cargo test --workspace --locked
4038

scripts/release.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,20 @@ err() { red "error: $*"; exit 1; }
3333
git diff --quiet && git diff --cached --quiet || err "working tree is dirty — commit or stash first"
3434

3535
# --- local quality gate (before touching anything) -------------------------
36-
# CI re-runs all of this after the tag is pushed, but verify locally first so a
37-
# release is never started on code that doesn't format, lint, or test clean.
38-
# `cargo test --workspace` includes the CLI end-to-end test
39-
# (crates/runtime-cli/tests) that spawns the real `esrun` binary.
40-
# Reuses the existing target/ cache (no clean) — incremental on a warm tree.
41-
# A cold tree is slow once (downloads/links the prebuilt V8 static lib).
42-
bold "Running fmt, clippy, and the full test suite…"
36+
# Verify locally first so a release is never started on code that doesn't
37+
# format, test, or lint clean. `cargo test --workspace` includes the CLI
38+
# end-to-end test (crates/runtime-cli/tests) that spawns the real `esrun`.
39+
# Reuses the existing target/ cache (no clean) — incremental on a warm tree;
40+
# a cold tree is slow once (downloads/links the prebuilt V8 static lib).
41+
#
42+
# Order matters: tests compile + link (which fetches the v8 prebuilt lib), so
43+
# they run before clippy — clippy runs in check mode and won't fetch it on a
44+
# cold tree.
45+
bold "Running fmt, the full test suite, and clippy…"
4346
cargo fmt --all --check || err "formatting check failed — run 'cargo fmt' and retry"
47+
cargo test --workspace --locked || err "tests failed — fix them and retry"
4448
cargo clippy --workspace --all-targets --locked -- -D warnings ||
4549
err "clippy failed — fix the warnings and retry"
46-
cargo test --workspace --locked || err "tests failed — fix them and retry"
4750

4851
branch="$(git rev-parse --abbrev-ref HEAD)"
4952

0 commit comments

Comments
 (0)