name: ci
on:
push:
branches: ["main"]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust toolchain (stable + components)
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --all-targets --all-features