ci: install the clippy component the Clippy step needs
`dtolnay/rust-toolchain@stable` installs a minimal profile. The `native`
job named no components, so every run that reached the Clippy step died
on
error: 'cargo-clippy' is not installed for the toolchain
'stable-aarch64-unknown-linux-gnu'
before clippy read a line of source. That is not a lint result; the step
had never run. The `fmt` job below always named `components: rustfmt`
correctly — this one never did.
Two lines of behaviour change. The rest is the comment explaining why the
step is left gating on `-D warnings` rather than softened: the workspace
is not clippy-clean (run 203's build alone emits ~13 rustc warnings that
`-D warnings` promotes to errors), and `continue-on-error` cannot tell
"debt not yet paid" from "debt paid". That debt is scoped in #13, the way
the rustfmt debt is in #12.
Run 203 is what made this visible. With the aarch64 fix in c457320 the
native job got all the way through:
cargo check --workspace ok 10m01s
cargo build --workspace ok 19m04s
cargo test --workspace ok 16m22s 214 passed, 0 failed
cargo clippy --workspace toolchain error
Refs #13
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01McNbzUeq1KRBWs4G6X2YVj
This commit is contained in:
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -42,7 +42,15 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
# `stable` installs a MINIMAL profile: rustc, cargo, rust-std and no
|
||||
# more. Components have to be named. Without this line the Clippy step
|
||||
# below dies on "'cargo-clippy' is not installed for the toolchain
|
||||
# 'stable-aarch64-unknown-linux-gnu'" — which is not a lint result, it
|
||||
# is the step never having run. The `fmt` job below always got this
|
||||
# right; this one never did.
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Cache Cargo registry and build
|
||||
uses: Swatinem/rust-cache@v2
|
||||
@@ -69,6 +77,20 @@ jobs:
|
||||
- name: Run tests
|
||||
run: cargo test --workspace
|
||||
|
||||
# This step has never once executed on this codebase: the toolchain above
|
||||
# shipped without the component, so every run died on "not installed"
|
||||
# before clippy saw a line of source. Its result was never pass or fail,
|
||||
# only unmeasured. With the component installed it becomes a real check,
|
||||
# and the first honest thing it will report is that the workspace is not
|
||||
# clean — the build already emits ~13 plain rustc warnings (unused
|
||||
# imports, unused variables, needless `mut`, dead fields) that
|
||||
# `-D warnings` promotes to errors, before clippy's own lints are counted.
|
||||
#
|
||||
# Left gating on purpose. A red check that measures something is worth
|
||||
# more than a green one that measures nothing, and the alternative —
|
||||
# `continue-on-error`, or dropping `-D warnings` — cannot tell "debt not
|
||||
# yet paid" from "debt paid", which is the shape PROTOCOL.md forbids.
|
||||
# The debt is scoped in #13, as the rustfmt debt is in #12.
|
||||
- name: Clippy
|
||||
run: cargo clippy --workspace -- -D warnings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user