name: CI
on:
push:
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
quality:
name: Format and Clippy
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
competitor-harness:
name: Competitor harness
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
components: rustfmt, clippy
- name: Check harness formatting
run: cargo fmt --manifest-path tools/competitor-bench/Cargo.toml -- --check
- name: Lint harness
run: cargo clippy --locked --manifest-path tools/competitor-bench/Cargo.toml --all-targets -- -D warnings
- name: Test harness
run: cargo test --locked --manifest-path tools/competitor-bench/Cargo.toml --all-targets
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025, macos-15]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Run all tests
run: cargo test --locked --all-targets
msrv:
name: Rust 1.88 (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025, macos-15]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: 1.88.0
- name: Test the minimum supported Rust version
run: cargo test --locked --all-targets
docs-and-package:
name: Documentation and package
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
- name: Build documentation without warnings
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --locked --no-deps
- name: Run README and API doctests
run: cargo test --locked --doc
- name: Verify the publishable package
run: cargo package --locked
coverage:
name: Coverage (95% lines)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c with:
toolchain: stable
components: llvm-tools-preview
- uses: taiki-e/install-action@18b1216eba7f8039b0f8d131d5473787f0edce68 with:
tool: cargo-llvm-cov
- name: Enforce line coverage
run: cargo llvm-cov --workspace --fail-under-lines 95