Fix quote version in the CI for build no_std #2681
This file contains hidden or 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 | |
| env: | |
| # Disable LTO in CI to avoid very slow/hanging release test builds on macOS (rustc/LLVM). | |
| CARGO_PROFILE_RELEASE_LTO: "off" | |
| run: cargo test --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}} | |
| - if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get -y install libfontconfig1-dev | |
| - name: Remove lockfile to build with latest dependencies | |
| run: rm Cargo.lock | |
| - name: Build crate | |
| run: cargo build --all-features --verbose | |
| - name: Verify working directory is clean (excluding lockfile) | |
| run: git diff --exit-code ':!Cargo.lock' | |
| build-nostd: | |
| name: Build no_std for target ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - wasm32-wasi | |
| - thumbv7em-none-eabihf | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: crate_root | |
| # 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 --edition 2021 --lib ci-build | |
| - name: Copy Rust version into synthetic crate | |
| run: cp crate_root/rust-toolchain.toml ci-build/ | |
| - name: Copy patch directives into synthetic crate | |
| run: | | |
| echo "[patch.crates-io]" >> ./ci-build/Cargo.toml | |
| cat ./crate_root/Cargo.toml | sed "0,/.\+\(patch.crates.\+\)/d" >> ./ci-build/Cargo.toml | |
| - name: Add no_std pragma to lib.rs | |
| run: | | |
| echo "#![no_std]" > ./ci-build/src/lib.rs | |
| - name: Add dependencies of the synthetic crate (e.g. sapling-crypto) | |
| working-directory: ./ci-build | |
| run: cargo add --no-default-features --path ../crate_root | |
| - name: Add lazy_static with the spin_no_std feature | |
| working-directory: ./ci-build | |
| run: cargo add lazy_static --no-default-features --features "spin_no_std" | |
| - name: Add typenum with the no_std feature | |
| working-directory: ./ci-build | |
| run: cargo add typenum --no-default-features --features "no_std" | |
| - name: Show Cargo.toml for the synthetic crate | |
| working-directory: ./ci-build | |
| run: cat Cargo.toml | |
| - name: Copy pinned dependencies into synthetic crate | |
| run: cp crate_root/Cargo.lock ci-build/ | |
| - name: Add target | |
| working-directory: ./ci-build | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Pin deps to versions compatible with rustc 1.70 | |
| working-directory: ./ci-build | |
| run: | | |
| cargo update -p unicode-ident --precise 1.0.12 | |
| cargo update -p syn --precise 2.0.114 | |
| cargo update -p quote --precise 1.0.33 | |
| - name: Build no_std for target | |
| working-directory: ./ci-build | |
| run: cargo build --locked --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 --benches | |
| book: | |
| name: Book tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mdbook | |
| run: | | |
| mkdir mdbook | |
| curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.35/mdbook-v0.4.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | |
| echo `pwd`/mdbook >> $GITHUB_PATH | |
| - name: Test Orchard book | |
| run: mdbook test book/ | |
| codecov: | |
| name: Code coverage | |
| runs-on: ubuntu-latest | |
| container: | |
| image: xd009642/tarpaulin:develop-nightly | |
| options: --security-opt seccomp=unconfined | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate coverage report | |
| run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3.1.4 | |
| 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 crates. | |
| - run: sudo apt-get update && sudo apt-get -y install libfontconfig1-dev | |
| - name: Check intra-doc links | |
| run: cargo doc --all-features --document-private-items | |
| fmt: | |
| name: Rustfmt | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cargo fmt -- --check |