name: CI
on:
push:
branches: [master]
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Build, lint, audit, test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
- name: Build
run: cargo build --release
- name: Check formatting
run: cargo fmt --check
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Cargo audit
uses: rustsec/audit-check@858dc40f52ca2b8570b7a997c1c4e35c6fc9a432
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run test suite
run: cargo test --release
- name: Check Rust version compatibility
run: cargo hack check --rust-version --all-targets