Overview
Add a GitHub Actions CI workflow to automatically validate code quality on every push and pull request.
Workflow file
Create .github/workflows/ci.yml with the following content:
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --check
- name: Clippy (lint)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-features
- name: Test
run: cargo test --all-features
Checklist
Implementation notes
Implemented in PR #6 (issues/#2,#3,#4, commit 71d993d):
.github/workflows/ci.yml added (SHA-pinned actions, permissions: contents: read, persist-credentials: false, restore-keys)
- Invalid
.github/workflows/rust.yml stub removed
- Build & Test and Codacy checks green on latest commit
Labels
ci, dx, good first issue
Overview
Add a GitHub Actions CI workflow to automatically validate code quality on every push and pull request.
Workflow file
Create
.github/workflows/ci.ymlwith the following content:Checklist
.github/workflows/ci.ymlCargo.tomlhas[workspace]or single-package setup-D warningscargo testmainImplementation notes
Implemented in PR #6 (
issues/#2,#3,#4, commit71d993d):.github/workflows/ci.ymladded (SHA-pinned actions,permissions: contents: read,persist-credentials: false,restore-keys).github/workflows/rust.ymlstub removedLabels
ci,dx,good first issue