Repository navigation
ci: add cargo fmt, clippy, and test to CI pipeline - #61
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflow to run Rust formatting, linting, and unit tests for the generator crate before building and generating fixtures, ensuring failures are caught earlier in the pipeline.
Changes:
- Add
cargo fmt --checkto enforce Rust formatting in CI - Add
cargo clippy -- -D warningsto fail CI on clippy warnings - Add
cargo testto run unit tests in CI before the build step
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Check formatting | ||
| working-directory: generator | ||
| run: cargo fmt --check | ||
|
|
||
| - name: Clippy | ||
| working-directory: generator | ||
| run: cargo clippy -- -D warnings |
There was a problem hiding this comment.
cargo fmt and cargo clippy require the rustfmt and clippy rustup components. The workflow installs dtolnay/rust-toolchain@stable without specifying components, so these steps may fail on runners where the components aren’t preinstalled. Consider configuring the toolchain step with components: rustfmt, clippy (or explicitly running rustup component add rustfmt clippy) to make CI deterministic.
Summary
cargo fmt --checkto enforce consistent formattingcargo clippy -- -D warningsto catch lint issuescargo testto run unit tests in CIAll three steps run before the build step so failures are caught early.
Closes #53