
TestingGuide
Continuous Integration for Rust Test Format Lint Build
A good Rust pipeline runs the same few checks in the same order every time. Format, clippy, tests, docs and a cache cover most projects in about forty lines of YAML.
14 min read
Tag
4 posts

A good Rust pipeline runs the same few checks in the same order every time. Format, clippy, tests, docs and a cache cover most projects in about forty lines of YAML.

Feature flags multiply build configurations. See the combinations that fail, how cargo hack tests them, and rules for additive features that keep builds safe.

Cache the Cargo registry and target directory in CI with Swatinem/rust-cache. Learn what is cached, the cache key, why caches go stale and how to keep restore times low.

Build SQLx code without a database by saving query metadata in .sqlx with cargo sqlx prepare. Includes the CI check that keeps it fresh and the errors when it is stale.