|
16 | 16 | token: ${{ secrets.GITHUB_TOKEN }}
|
17 | 17 | working-directory: ${{ inputs.target }}
|
18 | 18 | 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 typenum with the no_std feature |
| 54 | + working-directory: ./ci-build |
| 55 | + run: cargo add typenum --features "no_std" |
| 56 | + - name: Show Cargo.toml for the synthetic crate |
| 57 | + working-directory: ./ci-build |
| 58 | + run: cat Cargo.toml |
| 59 | + - name: Add target |
| 60 | + working-directory: ./ci-build |
| 61 | + run: rustup target add ${{ matrix.target }} |
| 62 | + - name: Clippy no_std for target |
| 63 | + working-directory: ./ci-build |
| 64 | + run: cargo clippy --verbose --target ${{ matrix.target }} |
0 commit comments