The dev -> rc -> main flow left rc ungated: push/pull_request triggers only listed main and dev, so a release candidate branch could drift without CI ever running against it. Add rc to both branch lists.
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: CI Quality Gates & Build Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, dev, rc ]
|
|
pull_request:
|
|
branches: [ main, dev, rc ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: "-D warnings"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
fmt:
|
|
name: Code Formatting Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
# No toolchain-install action: rust-toolchain.toml pins 1.97.1 (+ rustfmt,
|
|
# clippy) and rustup auto-installs it on first cargo/rustc invocation, so
|
|
# CI always matches the local pinned toolchain instead of a drifting
|
|
# `stable`.
|
|
- name: Check Formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy Linter Audit (Zero Warnings)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Cache Cargo Dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Run Clippy Linter (all targets, matches local `cargo check-all`)
|
|
run: cargo check-all
|
|
|
|
test:
|
|
name: Test Suite Execution
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Cache Cargo Dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Run Workspace Tests
|
|
run: cargo test-all
|
|
|
|
coverage:
|
|
name: Code Coverage (informational)
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Install llvm-tools component
|
|
run: rustup component add llvm-tools-preview
|
|
- name: Install cargo-llvm-cov
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
- name: Cache Cargo Dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
# Coverage is informational only (matches the local `cargo cov` alias):
|
|
# no --fail-under-lines threshold, and the job is continue-on-error so a
|
|
# coverage regression or tooling hiccup never reds the pipeline. A
|
|
# realistic coverage gate is a separate roadmap story.
|
|
- name: Measure Code Coverage (informational)
|
|
run: cargo cov
|
|
|
|
build-matrix:
|
|
name: Cross-Platform Build Matrix (${{ matrix.os }})
|
|
needs: [fmt, clippy, test, coverage]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Cache Cargo Dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Build All Workspace Crates
|
|
run: cargo build --workspace --all-targets
|