name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
rust: [stable, nightly]
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v7.0.1
- name: Install ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2.9.2
- name: Run tests
run: cargo test --workspace --no-fail-fast
- name: Run tests (all features)
run: cargo test --workspace --no-fail-fast --all-features
check_fmt_and_docs:
name: Lints and Docs
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v7.0.1
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy
- run: cargo clippy --no-default-features --features aes,hkdfsha2,nistp,serde
- name: Docs
run: cargo doc --no-deps
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Format
run: cargo +nightly fmt --all --message-format human -- --check