name: CI
on:
push:
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }}, Rust ${{ matrix.toolchain }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
toolchain: stable
- os: macos-latest
toolchain: stable
- os: windows-latest
toolchain: stable
- os: ubuntu-latest
toolchain: 1.85.0
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.toolchain }}
run: >-
rustup toolchain install ${{ matrix.toolchain }}
--profile minimal
--no-self-update
- name: Test all targets and features
run: >-
rustup run ${{ matrix.toolchain }}
cargo test --all-targets --all-features
minimal-features:
name: Test minimal features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable Rust
run: rustup toolchain install stable --profile minimal --no-self-update
- name: Test without optional features
run: rustup run stable cargo test --all-targets --no-default-features
quality:
name: Formatting, lint, documentation, and package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable Rust with lint components
run: >-
rustup toolchain install stable
--profile minimal
--component rustfmt
--component clippy
--no-self-update
- name: Check formatting
run: rustup run stable cargo fmt --all -- --check
- name: Lint all targets and features
run: >-
rustup run stable
cargo clippy --all-targets --all-features -- -D warnings
- name: Test documentation
run: rustup run stable cargo test --doc --all-features
- name: Build documentation with warnings denied
run: rustup run stable cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
- name: Verify release package
run: rustup run stable cargo package