Skip to content

ci: add WASM no-std compliance check to pipeline#65

Merged
Icahbod merged 1 commit into
ApexChainx:mainfrom
Mirabel64:ci/wasm-no-std-compliance-check
Jun 24, 2026
Merged

ci: add WASM no-std compliance check to pipeline#65
Icahbod merged 1 commit into
ApexChainx:mainfrom
Mirabel64:ci/wasm-no-std-compliance-check

Conversation

@Mirabel64

Copy link
Copy Markdown
Contributor

Summary

Resolves #12 by adding a dedicated cargo check --target wasm32-unknown-unknown --lib step to the client-checks job in .github/workflows/ci.yml.

Problem

README.md documents the cargo check --target wasm32-unknown-unknown --lib no-std compliance check, but it was not exercised in CI. A stray use std::... or println! would compile fine under cargo test on the host (which re-enables std via the test harness) yet fail at deployment time.

Fix

Add a single step right after the existing toolchain install (which already pulls the wasm32-unknown-unknown target):

- name: WASM no-std compliance check
  working-directory: apexchainx_calculator
  run: |
    cargo check --target wasm32-unknown-unknown --lib 2>&1 | tee no_std_check.log \
      || (echo "=== no_std compliance check failed: std imports are not allowed in WASM ===" \
          && cat no_std_check.log && exit 1)

Pattern mirrors the existing Cargo check step (host) so logs are consistent on failure.

Acceptance criteria from #12

  • CI includes a wasm32 no-std check.
  • Runs on every push/PR (job covers on: push and pull_request).
  • Installs wasm32 target (already installed by the prior toolchain step in the client-checks job).
  • Fails if a std import is introduced.
  • Passes on the current codebase — lib.rs declares #![no_std] and a project-wide grep finds no use std:: references.

Closes #12

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 ApexChainx#12

@Icahbod Icahbod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Icahbod Icahbod merged commit 586b95c into ApexChainx:main Jun 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add WASM no-std compliance check to CI pipeline

2 participants