name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "v*.*.*"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
stable:
name: Stable
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt,clippy
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Lint
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: Test default features
run: cargo test --locked
- name: Test all features
run: cargo test --all-features --locked
- name: Build docs
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --all-features --locked
- name: Verify packaging
run: cargo package --locked
wasm:
name: Stable (wasm)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install stable toolchain with wasm target
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
- name: Build Cloudflare Worker feature for wasm
run: cargo build --features cloudflare-worker --target wasm32-unknown-unknown --locked
msrv:
name: MSRV 1.85.0
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@1.85.0
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
- name: Test all features on MSRV
run: cargo test --all-features --locked
reuse:
name: REUSE
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Check REUSE compliance
uses: fsfe/reuse-action@v6