name: CI
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Lint
run: cargo clippy --locked --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --locked --all-targets --all-features