name: CI
on:
push:
branches: [main, master]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
ci:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --check
- name: Clippy (with doc lints)
run: cargo clippy --all-features -- -D warnings
- name: Tests
run: cargo test --all-features
- name: Doc build
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "-D warnings"
- name: Security audit
run: |
cargo install cargo-audit --quiet
cargo audit