[FEAT] Add CI/CD pipeline using GitHub Actions
📝 Description
Add an automated Continuous Integration (CI) pipeline using GitHub Actions to automatically test, lint, and format the codebase on every push and Pull Request.
Currently, code quality checks rely on manual local testing. As the project grows and receives external contributions, we need an automated gatekeeper to ensure that new code doesn't break the build or violate our style guidelines.
💡 Motivation
- Maintain Code Quality: Automatically enforce
cargo fmt and cargo clippy rules across all contributions.
- Prevent Broken Builds: Ensure that
cargo test and cargo build pass on supported platforms before a PR can be merged.
- Save Maintainer Time: Automate the review process for basic code standards, allowing the maintainer to focus on logic and architecture rather than missing semicolons or formatting issues.
- Boost Contributor Confidence: Give external contributors immediate feedback on their PRs (e.g., green checkmarks) without waiting for a manual review.
⚙️ Technical Details
We will use GitHub Actions to create a workflow file at .github/workflows/rust.yml.
The pipeline should include the following steps:
- Checkout: Clone the repository.
- Install Rust Toolchain: Use
dtolnay/rust-toolchain to install the stable Rust version.
- Cache Dependencies: Use
Swatinem/rust-cache to drastically speed up subsequent builds.
- Format Check: Run
cargo fmt --all -- --check.
- Linting: Run
cargo clippy --all-targets --all-features -- -D warnings (treat warnings as errors).
- Testing & Building: Run
cargo test and cargo build --release.
Optional (for future CD): Add a separate job or workflow to automatically publish to crates.io or create a GitHub Release when a new tag is pushed.
🔄 Alternatives Considered
- Travis CI / CircleCI: Rejected. GitHub Actions is natively integrated into the GitHub UI, free for public repositories, and requires no external account setup.
- Local pre-commit hooks only: Rejected. While useful for local development, they can be bypassed by contributors. Server-side CI is mandatory for open-source projects.
Additional Context
- Trigger: The workflow should trigger on
push to the main/dev branches and on pull_request events.
- Matrix Builds (Future Scope): Eventually, we should expand this to test across multiple OS targets (Ubuntu, Windows, macOS) to support our cross-platform goals (see related issue on Windows support).
- Standard Template: We can base our initial setup on the official GitHub Actions for Rust community templates.
✅ Acceptance Criteria
[FEAT] Add CI/CD pipeline using GitHub Actions
📝 Description
Add an automated Continuous Integration (CI) pipeline using GitHub Actions to automatically test, lint, and format the codebase on every push and Pull Request.
Currently, code quality checks rely on manual local testing. As the project grows and receives external contributions, we need an automated gatekeeper to ensure that new code doesn't break the build or violate our style guidelines.
💡 Motivation
cargo fmtandcargo clippyrules across all contributions.cargo testandcargo buildpass on supported platforms before a PR can be merged.⚙️ Technical Details
We will use GitHub Actions to create a workflow file at
.github/workflows/rust.yml.The pipeline should include the following steps:
dtolnay/rust-toolchainto install the stable Rust version.Swatinem/rust-cacheto drastically speed up subsequent builds.cargo fmt --all -- --check.cargo clippy --all-targets --all-features -- -D warnings(treat warnings as errors).cargo testandcargo build --release.Optional (for future CD): Add a separate job or workflow to automatically publish to
crates.ioor create a GitHub Release when a new tag is pushed.🔄 Alternatives Considered
Additional Context
pushto themain/devbranches and onpull_requestevents.✅ Acceptance Criteria
.github/workflows/rust.ymlfile is created.cargo fmt,cargo clippy, andcargo test.