Skip to content

Conversation

marcelomamorim
Copy link
Collaborator

@marcelomamorim marcelomamorim commented Nov 2, 2024

Add Rust CI Workflow for Continuous Integration

Description

This PR introduces a GitHub Actions workflow file (ci.yml) to automate the continuous integration (CI) process for our Rust project. The workflow is triggered on push and pull_request events to the main branch and performs the following steps:

  1. Checkout Code: Checks out the repository code.
  2. Install Rust: Installs the Rust stable toolchain using actions-rs/toolchain.
  3. Code Check: Runs cargo check to ensure the code compiles without producing an executable.
  4. Code Formatting Check: Verifies code formatting with cargo fmt -- --check. The workflow fails if formatting issues are found.
  5. Run Tests: Runs tests using cargo test to validate the codebase functionality.

Workflow File Summary

  • Location: .github/workflows/ci.yml
  • Triggers: push and pull_request events on the main branch
  • Steps:
    • cargo check for compilation without building
    • cargo fmt -- --check to check code formatting
    • cargo test to run all tests in the codebase

Motivation and Context

This CI workflow aims to enforce code quality and ensure that all code changes are:

  • Compiling without errors
  • Properly formatted
  • Passing all tests

Checklist

  • I have read the contribution guidelines
  • My code follows the style guidelines of this project
  • I have added tests to cover my changes
  • All new and existing tests pass
  • My changes do not introduce any new warnings

Additional Comments

Please review and provide any suggestions on steps or optimizations. Thank you!

Copy link
Collaborator

@helpmehelpus helpmehelpus left a comment

Choose a reason for hiding this comment

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

Nice!!

Quick question: do we to need to actually build the project in this step, or can we get away with just ´cargo check´?

@marcelomamorim
Copy link
Collaborator Author

Nice!!

Quick question: do we to need to actually build the project in this step, or can we get away with just ´cargo check´?

Thanks! Good point. I agree with the suggestion — cargo check should be sufficient here. I'll make the change!

@marcelomamorim marcelomamorim merged commit 3660246 into main Nov 4, 2024
1 check passed
EmersonJr pushed a commit to EmersonJr/r-python that referenced this pull request Feb 12, 2025
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