LeVCS/.github/workflows/ci.yml

66 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
# Gate: workspace must build and the full test suite must pass.
# Includes a compile-check of the criterion benches so a broken
# bench doesn't go unnoticed between manual `cargo bench` runs.
test:
name: build + test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo + target
uses: Swatinem/rust-cache@v2
- name: Build workspace
run: cargo build --workspace --all-targets
- name: Run tests
run: cargo test --workspace
- name: Compile-check benches
run: cargo build --workspace --benches
# Informational: surfaces formatting drift without blocking merges.
# Flip continue-on-error to false (or remove the line) once the
# codebase is fmt-clean.
fmt:
name: fmt (informational)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
# Informational: clippy lints with default severity. Same deal as
# fmt — when the codebase is lint-clean, drop continue-on-error and
# add `-- -D warnings` to make this a real gate.
clippy:
name: clippy (informational)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets