Skip to content

Commit dc95cec

Browse files
committed
Add clippy for a no_std target.
Signed-off-by: Daira-Emma Hopwood <[email protected]>
1 parent 01878e2 commit dc95cec

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/lints-stable.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,43 @@ jobs:
1616
token: ${{ secrets.GITHUB_TOKEN }}
1717
working-directory: ${{ inputs.target }}
1818
deny: warnings
19+
20+
clippy-nostd:
21+
name: Clippy (MSRV) no_std for ${{ matrix.target }}
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
target:
26+
- wasm32-wasi
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
path: crate_root
31+
# We use a synthetic crate to ensure no dev-dependencies are enabled, which can
32+
# be incompatible with some of these targets.
33+
- name: Create synthetic crate for testing
34+
run: cargo init --edition 2021 --lib ci-build
35+
- name: Copy Rust version into synthetic crate
36+
run: cp crate_root/rust-toolchain.toml ci-build/
37+
- name: Copy patch directives into synthetic crate
38+
run: |
39+
echo "[patch.crates-io]" >> ./ci-build/Cargo.toml
40+
cat ./crate_root/Cargo.toml | sed "0,/.\+\(patch.crates.\+\)/d" >> ./ci-build/Cargo.toml
41+
- name: Add no_std pragma to lib.rs
42+
run: |
43+
echo "#![no_std]" > ./ci-build/src/lib.rs
44+
- name: Add dependencies of the synthetic crate (e.g. sapling-crypto)
45+
working-directory: ./ci-build
46+
run: cargo add --no-default-features --features circuit --path ../crate_root
47+
- name: Add orchard with the circuit feature
48+
working-directory: ./ci-build
49+
run: cargo add orchard --no-default-features --features "circuit" --path ../crate_root
50+
- name: Add lazy_static with the spin_no_std feature
51+
working-directory: ./ci-build
52+
run: cargo add lazy_static --features "spin_no_std"
53+
- name: Add target
54+
working-directory: ./ci-build
55+
run: rustup target add ${{ matrix.target }}
56+
- name: Clippy no_std for target
57+
working-directory: ./ci-build
58+
run: cargo clippy --verbose --target ${{ matrix.target }}

0 commit comments

Comments
 (0)