name: CI
on:
pull_request:
push:
branches: [main]
jobs:
build-test:
name: fmt • clippy • test • doc • ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust (stable + components)
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: rustfmt (check)
run: cargo fmt --all -- --check
- name: clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Tests (all targets)
run: cargo test --all-features --all-targets --no-fail-fast
- name: Build docs (fail on warnings)
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --all-features