name: CI
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-test:
name: Lint and unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (default features)
run: cargo clippy --all-targets -- -D warnings
- name: Clippy (all features)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Unit tests
run: cargo test
- name: Doc tests
run: cargo test --doc
- name: Check docs build
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "-D warnings"
msrv:
name: MSRV check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- run: cargo check --all-features
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cargo cache
uses: Swatinem/rust-cache@v2
- name: Integration tests
env:
RUST_BACKTRACE: "1"
run: cargo test --features integration-tests -- --nocapture
security:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-audit
run: cargo install cargo-audit
- name: Run audit
run: cargo audit