Skip to content

Commit 586b95c

Browse files
authored
ci: add WASM no-std compliance check to pipeline (#12) (#65)
Adds a dedicated cargo check --target wasm32-unknown-unknown --lib step to the client-checks job so any accidental std import surfaces as a compile error before deployment. The wasm32 target is already installed in the prior toolchain step, and the existing no_std declaration in lib.rs ensures the check passes on the current codebase. Closes #12
1 parent 6fd7a51 commit 586b95c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ jobs:
3131
targets: wasm32-unknown-unknown
3232
components: rustfmt, clippy
3333

34+
# Issue #12: WASM no-std compliance check.
35+
# Compiles only the library crate for wasm32-unknown-unknown so that any
36+
# accidental `std` import surfaces here (before deployment) as a compile
37+
# error. Invokes the wasm32 compiler from the host runner via `cargo check`,
38+
# which is cheaper than the `Build WASM` step below (metadata only, no codegen).
39+
- name: WASM no-std compliance check
40+
working-directory: apexchainx_calculator
41+
run: |
42+
cargo check --target wasm32-unknown-unknown --lib 2>&1 | tee no_std_check.log \
43+
|| (echo "=== no_std compliance check failed: std imports are not allowed in WASM ===" \
44+
&& cat no_std_check.log && exit 1)
45+
3446
- name: Debug environment
3547
run: |
3648
echo "=== Rust toolchain ==="

0 commit comments

Comments
 (0)