name: CI
on:
push:
branches:
- main
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --locked -- -D warnings
- name: Build crate
run: cargo build --locked
- name: Run tests
run: cargo test --locked
- name: Build documentation
run: cargo doc --locked --no-deps