Skip to content

Build, test and lint on push - #285

Merged
SDL-A1 merged 2 commits into
mainfrom
ci/build-test-lint
Oct 7, 2026
Merged

SDL-A1 merged 2 commits into
mainfrom
ci/build-test-lint

Conversation

@SDL-A1

@SDL-A1 SDL-A1 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Until now nothing did. .github/workflows held one file and it only ran cargo-deny, so every PR's test evidence was a human pasting local output, and a linter had never run at all.

Closes #282.

What that cost

All found within an hour of installing clippy for the first time:

Why the matrix builds two configurations

Not symmetry for its own sake. cargo clippy --fix removed a mut that only the smtp build needs — the sinks.push it guards sits behind #[cfg(feature = "smtp")]. A default build compiled and all 2,046 tests passed, while --features smtp would not compile at all.

That is the configuration the production node runs. A single-configuration gate would have shipped it.

Jobs

job what it runs gating
test cargo build --locked + cargo test --locked, matrix {default: --workspace} and {smtp: -p rustock-cli --features smtp} yes
clippy --workspace --all-targets -- -D warnings, plus the same for --features smtp yes
fmt cargo fmt --all --check, reporting how many files differ advisory (continue-on-error)

--all-targets because the one genuine bug clippy found was in an example, which a bare cargo clippy does not lint.

RUSTFLAGS: -D warnings globally, because most of the real findings were plain rustc warnings — an unused import, an unreachable statement — rather than clippy lints.

Why fmt is advisory

296 files differ. Formatting them is a deliberate commit of its own; folding it in would bury any change in ~1,800 lines of churn. Reporting the count keeps it visible and shrinking rather than silently growing. Flip continue-on-error off once that commit lands.

Expected first run

The gate passes on main as of #281:

cargo clippy --workspace --all-targets -- -D warnings   exit 0
cargo test --workspace                                  2,046 passed
cargo test -p rustock-cli --features smtp                  27 passed

The fmt job will report ~296 files and stay green by design.

Note: the existing cargo-deny job logs override toolchain '1.93.1-x86_64-unknown-linux-musl' is not installed, so rust-toolchain.toml is not honoured there. This workflow pins the toolchain explicitly instead.

🤖 Generated with Claude Code

Until now nothing did. `.github/workflows` held one file and it only ran
cargo-deny, so every PR's test evidence was a human pasting local output, and a
linter had never run at all.

What that cost, all found within an hour of installing clippy for the first
time: a test that had lost its `#[test]` attribute and never ran, `#[test]`
applied twice to another, `#[cfg(test)]` twice on a module, 189 clippy warnings
across 153 sites including a real bug (`tip.max(N).min(N)` is always the
constant), three doc comments damaged by pasted section headers, and 296 files
drifted from rustfmt.

The matrix builds both the default and `smtp` configurations. That is not
symmetry for its own sake. `cargo clippy --fix` removed a `mut` that only the
smtp build needs -- the `sinks.push` it guards sits behind
`#[cfg(feature = "smtp")]` -- so a default build compiled and all 2,046 tests
passed while `--features smtp`, which is what the production node runs, would
not compile at all. A single-configuration gate would have shipped that.

Clippy runs with `--all-targets` for the same reason: the one genuine bug it
found was in an example, which a bare `cargo clippy` does not lint.
`RUSTFLAGS: -D warnings` is set globally because most of the real findings were
plain rustc warnings -- an unused import, an unreachable statement -- rather
than clippy lints.

Rustfmt is advisory. 296 files differ; formatting them is a deliberate commit
of its own, and folding it in here would bury this change in ~1,800 lines of
churn. Reporting the count keeps it visible and shrinking rather than silently
growing.

Pinned to the toolchain in rust-toolchain.toml. Note that the existing
cargo-deny job logs that the same toolchain is not installed, so that file is
not honoured there either.

Closes #282

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`continue-on-error` stops a failing job failing the run, but the check itself
still reports red -- so the first run showed "Rustfmt (advisory)  fail", which
is exactly what the advisory marking was meant to avoid.

A check that is expected to be red is worse than no check. This repository
already has a permanently-failing cargo-deny job that everyone has learned to
scroll past; a second one makes a real failure easier to miss, because red
stops carrying information.

The step now captures the count, writes it to the job summary, and exits 0.
Green, with a number that can be watched shrinking. Promote it to gating --
drop the `|| true` and the `continue-on-error` -- once the formatting commit
lands.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SDL-A1
SDL-A1 merged commit 4a955f1 into main Oct 7, 2026
6 of 7 checks passed
@SDL-A1
SDL-A1 deleted the ci/build-test-lint branch October 7, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: nothing builds, tests or lints on push

2 participants