bottlerocket
bottlerocket copied to clipboard
build: check clippy and cargo fmt during github actions checks
What I'd like:
During GitHub actions CI, the build should fail (preferably early) if the code is not fmt'ed with cargo fmt and if it has cargo clippy warnings.
We probably wouldn't want this to happen as part of the RPM build process. Instead this would probably be more like what we do now with cargo test. The downside is that a mismatch between the version of cargo in the build runners and a developer's local version of cargo could cause a mismatch in clippy lints (less likely that a fmt mismatch would occur).
Any alternatives you've considered:
- Doing this with the SDK
- Doing this with "local" cargo/rust
- Don't check lint/fmt in CI
The simplest solution might be to add these under the existing target cargo make test. (Note that cargo make test only runs sources tests currently. We should probably expand the cargo make test target to encompass both sources and tools)
Closing since this was accomplished earlier this year ✅
https://github.com/bottlerocket-os/bottlerocket/blob/4885e9a8502031d51f1215b51a775f738dc948ef/.github/workflows/build.yml#L118-L120