Rust CI
Rule
CI must mirror local validation and make failures actionable. Keep just check as the local
source of truth when present.
Hard Stops
Ask before:
- Adding providers, paid services, release credentials, publishing crates, signing, or uploading artifacts externally.
- Requiring nightly, changing MSRV/toolchain policy, or expanding supported OS/targets.
- Adding slow feature matrices, coverage uploads, Miri/sanitizers, or container services to every PR without approval.
Defaults
- Use stable Rust and project
rust-toolchain.tomlor repo toolchain policy. - Cache Cargo registry/git/build outputs through CI mechanisms.
- Fast PR gate: fmt check, Clippy with warnings denied, tests, doctests/docs, and build.
- Use
cargo nextestwhen configured; keepcargo test --docfor doctests. - Use
cargo deny checkand/orcargo auditwhen configured. - Scheduled/protected checks may add
cargo hackfeature/MSRV matrix, coverage withcargo llvm-cov, Miri/sanitizers for unsafe-heavy code, and dependency update checks. - Prefer invoking
just checkrather than duplicating command logic in YAML.
Workflow
- Inspect local commands, toolchain policy, workspace shape, and existing CI.
- Add or update jobs to call wrappers and install tools reproducibly.
- Configure caches and artifacts without committing generated outputs.
- Split fast PR checks from slower scheduled/release checks when needed.
- Validate YAML and run local
just check.
Antipatterns
- CI commands drifting from local wrappers.
- Installing latest cargo tools without a version policy.
- Running only
cargo buildand no tests/lints. - Ignoring feature combinations, MSRV, or security until release.
Completion
Report CI files changed, jobs, cache/tool strategy, local validation, and release gates.
Source: nyquistwilder/personal-pi — distributed by TomeVault.