Implement no_std
support via a default-enabled std
feature flag.
#218
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI checks | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: cargo test --all-features --verbose --release | |
- name: Verify working directory is clean | |
run: git diff --exit-code | |
build-latest: | |
name: Latest build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
id: toolchain | |
- run: rustup override set ${{steps.toolchain.outputs.name}} | |
- name: Remove lockfile to build with latest dependencies | |
run: rm Cargo.lock | |
- name: Build crate | |
run: cargo build --all-targets --all-features --verbose | |
- name: Verify working directory is clean (excluding lockfile) | |
run: git diff --exit-code ':!Cargo.lock' | |
build-nodefault: | |
name: Build target ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- wasm32-wasi | |
- thumbv7em-none-eabihf | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: crates | |
# We use a synthetic crate to ensure no dev-dependencies are enabled, which can | |
# be incompatible with some of these targets. | |
- name: Create synthetic crate for testing | |
run: cargo init --lib ci-build | |
- name: Copy Rust version into synthetic crate | |
run: cp crates/rust-toolchain.toml ci-build/ | |
- name: Copy patch directives into synthetic crate | |
run: | | |
echo "[patch.crates-io]" >> ./ci-build/Cargo.toml | |
cat ./crates/Cargo.toml | sed "0,/.\+\(patch.crates.\+\)/d" >> ./ci-build/Cargo.toml | |
- name: Add sapling-crypto as a dependency of the synthetic crate | |
working-directory: ./ci-build | |
run: cargo add --no-default-features --path ../crates/sapling-crypto | |
- name: Copy pinned dependencies into synthetic crate | |
run: cp crates/Cargo.lock ci-build/ | |
- name: Add target | |
working-directory: ./ci-build | |
run: rustup target add ${{ matrix.target }} | |
- name: Build for target | |
working-directory: ./ci-build | |
run: cargo build --verbose --target ${{ matrix.target }} | |
bitrot: | |
name: Bitrot check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Build benchmarks to prevent bitrot | |
- name: Build benchmarks | |
run: cargo build --all --benches | |
clippy: | |
name: Clippy (MSRV) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Clippy | |
uses: auguwu/clippy-action@1.4.0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: ${{ inputs.target }} | |
deny: warnings | |
doc-links: | |
name: Intra-doc links | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo fetch | |
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crate. | |
- name: Check intra-doc links | |
run: cargo doc --all-features --document-private-items | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check formatting | |
run: cargo fmt -- --check |