Skip to content

Add cargo check step to Rust CI workflow#3

Merged
tascord merged 1 commit intomainfrom
tascord-patch-1
Oct 3, 2025
Merged

Add cargo check step to Rust CI workflow#3
tascord merged 1 commit intomainfrom
tascord-patch-1

Conversation

@tascord
Copy link
Copy Markdown
Collaborator

@tascord tascord commented Oct 3, 2025

Added a step to run cargo check with warnings as errors.

Added a step to run cargo check with warnings as errors.
Copilot AI review requested due to automatic review settings October 3, 2025 13:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo check --verbose
run: RUSTFLAGS='-D warnings' cargo check --verbose

Copilot uses AI. Check for mistakes.
- name: Run check
run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo check --verbose
- name: Build
run: cargo build --verbose
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
run: cargo build --verbose
run: CARGO_BUILD_RUSTFLAGS='-D warnings' cargo build --verbose

Copilot uses AI. Check for mistakes.
@tascord tascord merged commit d339825 into main Oct 3, 2025
1 check failed
@tascord tascord deleted the tascord-patch-1 branch October 3, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants