Skip to content

Commit

Permalink
Add CI workflow for verifying no_std compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Dec 19, 2024
1 parent 4fa6d3b commit 474eb88
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,36 @@ jobs:
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 --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 sapling-crypto as a dependency of the synthetic crate
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 --features "spin_no_std"
- name: Add target
working-directory: ./ci-build
run: rustup target add ${{ matrix.target }}
- run: cargo fetch
- name: Build for ${{ matrix.target }} target
run: cargo build --verbose --no-default-features --target ${{ matrix.target }}
- name: Build for target
working-directory: ./ci-build
run: cargo build --verbose --target ${{ matrix.target }}

bitrot:
name: Bitrot check
Expand Down

0 comments on commit 474eb88

Please sign in to comment.