name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: fmt · clippy · test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add rustfmt + clippy
run: rustup component add rustfmt clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all --check
- name: Clippy (warnings are errors)
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test --all --locked