name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
check:
name: check / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: cargo fmt --check
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace --all-targets
- name: cargo doc
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings
msrv:
name: MSRV (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust 1.88
uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --workspace --all-targets