name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust (fmt / clippy / test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Rust build artefacts
uses: Swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy (default features)
run: cargo clippy --all-targets -- -D warnings
- name: cargo clippy (macros feature)
run: cargo clippy --all-targets --features macros -- -D warnings
- name: cargo test (default features)
run: cargo test
- name: cargo test (macros feature)
run: cargo test --features macros
- name: cargo build --release
run: cargo build --release