name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Cache cargo tools
uses: actions/cache@v4
id: cache-cargo-tools
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-tools-v1
- run: cargo build --workspace --all-targets --verbose
- run: cargo clippy --workspace --bins --lib -- -D warnings
- run: cargo fmt --all -- --check
- run: cargo test --workspace --verbose