name: ci
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Latest stable, the same channel rust-toolchain.toml selects, so CI and
# local stay in step. If a rustfmt/clippy release ever shifts a rule,
# re-run `cargo fmt --all` / fix the lint — no version to bump here.
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo build --verbose
- run: cargo test --verbose