name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
test:
name: Build, test, lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install stable toolchain
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt
- name: Cache cargo registry and build
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Format check
run: cargo fmt --check
- name: Clippy (warnings as errors)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-targets --all-features
- name: Test (full suite)
run: cargo test --all-features
- name: Packaging dry-run
run: cargo package --list