@@ -118,4 +118,88 @@ jobs:
118118 - name : Architecture check
119119 run : cross run --features cli --bin arch-check --target ${{ matrix.target }}
120120 - name : Test
121- run : cross test --features cli --target ${{ matrix.target }}
121+ run : cross test --features cli --target ${{ matrix.target }}
122+
123+ test-no-std :
124+ name : Test no_std
125+ runs-on : ubuntu-latest
126+ strategy :
127+ matrix :
128+ target :
129+ - thumbv7em-none-eabihf # ARM Cortex-M4F/M7F
130+ - thumbv8m.main-none-eabihf # ARM Cortex-M33/M35P
131+ - riscv32imac-unknown-none-elf # RISC-V 32-bit
132+ rust-toolchain :
133+ - " 1.81" # minimum for this crate
134+ - " stable"
135+ - " nightly"
136+ steps :
137+ - uses : actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
138+ - uses : actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
139+ with :
140+ toolchain : ${{ matrix.rust-toolchain }}
141+ target : ${{ matrix.target }}
142+ components : rustfmt, clippy
143+ cache-key : ${{ matrix.target }}-${{ matrix.rust-toolchain }}
144+ - name : Check no_std (no features)
145+ run : cargo check --target ${{ matrix.target }} --no-default-features --lib
146+ - name : Check no_std with alloc
147+ run : cargo check --target ${{ matrix.target }} --no-default-features --features alloc --lib
148+ - name : Check no_std with cache
149+ run : cargo check --target ${{ matrix.target }} --no-default-features --features cache --lib
150+ - if : ${{ matrix.target == 'thumbv7em-none-eabihf' }}
151+ name : Build no_std example
152+ run : cargo build --target ${{ matrix.target }} --manifest-path examples/no_std_embedded/Cargo.toml --release
153+ - name : Run no_std tests (on host with std test harness)
154+ run : cargo test --test no_std_tests
155+
156+ test-wasm :
157+ name : Test WASM
158+ runs-on : ubuntu-latest
159+ strategy :
160+ matrix :
161+ include :
162+ # WASM 1.0/2.0 (32-bit) - all toolchains
163+ - target : wasm32-unknown-unknown
164+ rust-toolchain : " 1.81"
165+ - target : wasm32-unknown-unknown
166+ rust-toolchain : " stable"
167+ - target : wasm32-unknown-unknown
168+ rust-toolchain : " nightly"
169+ # WASI preview 1 (32-bit) - all toolchains
170+ - target : wasm32-wasip1
171+ rust-toolchain : " 1.81"
172+ - target : wasm32-wasip1
173+ rust-toolchain : " stable"
174+ - target : wasm32-wasip1
175+ rust-toolchain : " nightly"
176+ # WASI preview 2 (32-bit) - nightly only (experimental)
177+ - target : wasm32-wasip2
178+ rust-toolchain : " nightly"
179+ # WASM 3.0 (64-bit address space) - nightly only (experimental)
180+ - target : wasm64-unknown-unknown
181+ rust-toolchain : " nightly"
182+ steps :
183+ - uses : actions/checkout@v4 # not pinning to commit hash since this is a GitHub action, which we trust
184+ - uses : actions-rust-lang/setup-rust-toolchain@9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 # v1.12.0
185+ with :
186+ toolchain : ${{ matrix.rust-toolchain }}
187+ target : ${{ matrix.target }}
188+ components : rustfmt, clippy
189+ cache-key : ${{ matrix.target }}-${{ matrix.rust-toolchain }}
190+ - name : Check WASM (no features)
191+ run : cargo check --target ${{ matrix.target }} --no-default-features --lib
192+ - name : Check WASM with alloc
193+ run : cargo check --target ${{ matrix.target }} --no-default-features --features alloc --lib
194+ - name : Check WASM with cache
195+ run : cargo check --target ${{ matrix.target }} --no-default-features --features cache --lib
196+ - name : Build WASM release
197+ run : cargo build --target ${{ matrix.target }} --no-default-features --features alloc --lib --release
198+ - name : Run WASM tests (on host with std test harness)
199+ run : cargo test --test wasm_tests
200+ - if : ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
201+ name : Install wasm-pack
202+ run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
203+ - if : ${{ matrix.target == 'wasm32-unknown-unknown' && matrix.rust-toolchain == 'stable' }}
204+ name : Build WASM package with wasm-pack
205+ run : wasm-pack build --target web --no-default-features --features alloc
0 commit comments