name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: ['1.88.0', stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
targets: wasm32-unknown-unknown
- name: Cache Cargo dependencies and build artifacts
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.toolchain }}-cargo-
- run: cargo test --locked
- if: matrix.toolchain == 'stable'
run: cargo test --no-default-features --locked
- if: matrix.toolchain == 'stable'
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- if: matrix.toolchain == 'stable'
run: cargo clippy --all-targets --no-default-features --locked -- -D warnings
- if: matrix.toolchain == 'stable'
run: cargo run --example inspect_proof --no-default-features --locked -- tests/fixtures/standalone.der
- if: matrix.toolchain == 'stable'
run: cargo run --example verify --locked -- tests/fixtures/ca.der tests/fixtures/standalone.der
- if: matrix.os == 'ubuntu-latest' && matrix.toolchain == 'stable'
run: cargo fmt --all --check
- if: matrix.os == 'ubuntu-latest' && matrix.toolchain == 'stable'
name: Check documentation, wasm and packaging
env:
RUSTDOCFLAGS: -D warnings
run: |
cargo doc --all-features --no-deps --locked
cargo doc --no-default-features --no-deps --locked
cargo build --no-default-features --target wasm32-unknown-unknown --locked
cargo package --all-features --locked
- if: matrix.os == 'ubuntu-latest' && matrix.toolchain == 'stable'
name: Check the base layer stays free of cryptographic backends
run: |
! cargo tree --edges no-dev --no-default-features --locked | grep -E 'p256|p384|ed25519-dalek|ml-dsa|signature'