name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }})
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Run tests
run: cargo test --locked