2323 with :
2424 toolchain : ${{ matrix.rust-toolchain }}
2525 components : rustfmt, clippy
26- cache-key : ${{ matrix.os }}-${{ matrix.rust-toolchain }}
26+ cache-key : ${{ matrix.os }}-${{ matrix.rust-toolchain }}-v2
2727 - name : Check
2828 run : cargo check --all-features
2929 - name : Architecture check
5454 with :
5555 toolchain : ${{ matrix.rust-toolchain }}
5656 components : rustfmt, clippy
57- cache-key : ${{ matrix.os }}-${{ matrix.rust-toolchain }}
57+ cache-key : ${{ matrix.os }}-${{ matrix.rust-toolchain }}-v2
5858 - name : Check
5959 run : cargo check --all-features
6060 - name : Architecture check
@@ -146,4 +146,83 @@ jobs:
146146 run : cargo miri nextest run --all-features -j${{ steps.cores.outputs.count }}
147147 - name : Run Miri tests (serial)
148148 if : steps.cores.outputs.use_nextest == 'false'
149- run : cargo miri test --all-features
149+ run : cargo miri test --all-features
150+
151+ test-no-std :
152+ name : Test no_std
153+ runs-on : ubuntu-latest
154+ strategy :
155+ matrix :
156+ target :
157+ - thumbv7em-none-eabihf # ARM Cortex-M4F/M7F
158+ - thumbv8m.main-none-eabihf # ARM Cortex-M33/M35P
159+ - riscv32imac-unknown-none-elf # RISC-V 32-bit
160+ rust-toolchain :
161+ - " 1.81" # minimum for this crate
162+ - " stable"
163+ - " nightly"
164+ steps :
165+ - uses : actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
166+ - uses : actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
167+ with :
168+ toolchain : ${{ matrix.rust-toolchain }}
169+ target : ${{ matrix.target }}
170+ components : rustfmt, clippy
171+ cache-key : ${{ matrix.target }}-${{ matrix.rust-toolchain }}-v2
172+ - name : Check no_std (no features)
173+ run : cargo check --target ${{ matrix.target }} --no-default-features --features panic-handler --lib
174+ - name : Check no_std with alloc
175+ run : cargo check --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib
176+ - name : Check no_std with cache
177+ run : cargo check --target ${{ matrix.target }} --no-default-features --features cache,panic-handler --lib
178+ - name : Run no_std tests (on host with std test harness)
179+ run : cargo test --test no_std_tests
180+
181+ test-wasm :
182+ name : Test WASM
183+ runs-on : ubuntu-latest
184+ strategy :
185+ matrix :
186+ include :
187+ # WASM 1.0/2.0 (32-bit) - all toolchains
188+ - target : wasm32-unknown-unknown
189+ rust-toolchain : " 1.81"
190+ - target : wasm32-unknown-unknown
191+ rust-toolchain : " stable"
192+ - target : wasm32-unknown-unknown
193+ rust-toolchain : " nightly"
194+ # WASI preview 1 (32-bit) - all toolchains
195+ - target : wasm32-wasip1
196+ rust-toolchain : " 1.81"
197+ - target : wasm32-wasip1
198+ rust-toolchain : " stable"
199+ - target : wasm32-wasip1
200+ rust-toolchain : " nightly"
201+ # WASI preview 2 (32-bit) - nightly only (experimental)
202+ - target : wasm32-wasip2
203+ rust-toolchain : " nightly"
204+ # Note: wasm64-unknown-unknown removed - not consistently available in nightly
205+ steps :
206+ - uses : actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
207+ - uses : actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
208+ with :
209+ toolchain : ${{ matrix.rust-toolchain }}
210+ target : ${{ matrix.target }}
211+ components : rustfmt, clippy
212+ cache-key : ${{ matrix.target }}-${{ matrix.rust-toolchain }}-v2
213+ - name : Check WASM (no features)
214+ run : cargo check --target ${{ matrix.target }} --no-default-features --features panic-handler --lib
215+ - name : Check WASM with alloc
216+ run : cargo check --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib
217+ - name : Check WASM with cache
218+ run : cargo check --target ${{ matrix.target }} --no-default-features --features cache,panic-handler --lib
219+ - name : Build WASM release
220+ run : cargo build --target ${{ matrix.target }} --no-default-features --features alloc,panic-handler --lib --release
221+ - name : Run WASM tests (on host with std test harness)
222+ run : cargo test --test wasm_tests
223+ - if : ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
224+ name : Install wasm-pack
225+ run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
226+ - if : ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
227+ name : Build WASM package with wasm-pack
228+ run : wasm-pack build --target web --no-default-features --features alloc,panic-handler
0 commit comments