Conversation
Added a step to run cargo check with warnings as errors.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a GitHub Actions CI workflow for Rust projects that includes cargo check with warnings treated as errors before building.
- Introduces a new Rust CI workflow that runs on pushes and pull requests to main branch
- Adds cargo check step with warnings as errors to catch potential issues early
- Includes standard cargo build step with verbose output
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Run check | ||
| run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo check --verbose |
There was a problem hiding this comment.
Consider using RUSTFLAGS environment variable instead of CARGO_BUILD_RUSTFLAGS for broader compatibility. RUSTFLAGS is the standard way to pass flags to rustc and works consistently across different cargo commands.
| run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo check --verbose | |
| run: RUSTFLAGS='-D warnings' cargo check --verbose |
| - name: Run check | ||
| run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo check --verbose | ||
| - name: Build | ||
| run: cargo build --verbose |
There was a problem hiding this comment.
The build step should also use the same RUSTFLAGS='-D warnings' to ensure consistency between check and build phases. This prevents warnings from being introduced that pass check but would fail in a production build with warnings as errors.
| run: cargo build --verbose | |
| run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo build --verbose |
Added a step to run cargo check with warnings as errors.