name: wai-quantum for JavaScript # The npm package @transaction-science/wai-quantum (wai/wai-quantum-js): the job # service's engine for WebAssembly (wai-web, feature quantum_engine) with its # bindings. ci/check.sh builds and packs it; the tarball, unpacked, holds the # package's allow-list and nothing else; the smoke test runs against what was # unpacked (a job run with a fresh key and its receipt verified, a forged result # refused, a program linted and drawn, a refusal with its diagnostic code); and the # tarball installed into an empty app runs the README's Node example by name. # Nothing is published. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: push: branches: [main] paths: - 'wai/wai-quantum-js/**' - 'wai/wai-web/**' - 'wai/wai-quantum/**' - 'wai/wai-rs/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-js.yml' pull_request: paths: - 'wai/wai-quantum-js/**' - 'wai/wai-web/**' - 'wai/wai-quantum/**' - 'wai/wai-rs/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-js.yml' jobs: relevant: name: does this change touch it runs-on: gate outputs: run: ${{ steps.gate.outputs.run }} steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - id: gate run: | set -euo pipefail r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-quantum-js.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches the npm package: $r" echo "run=$r" >> "$GITHUB_OUTPUT" js-linux: name: javascript ยท linux needs: relevant if: needs.relevant.outputs.run == 'true' runs-on: linux timeout-minutes: 60 steps: - uses: actions/checkout@v5 - name: Install Rust 1.99.1 with the wasm32 target shell: bash run: | export PATH="$HOME/.cargo/bin:$PATH" command -v rustup >/dev/null 2>&1 || \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1 rustup toolchain install 1.99.1 --profile minimal rustup default 1.99.1 rustup target add wasm32-unknown-unknown echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" # Pinned to the wasm-bindgen version in wai-web/Cargo.lock; build.sh refuses another. - name: wasm-bindgen CLI 0.2.127 shell: bash run: cargo install --locked wasm-bindgen-cli --version 0.2.127 - uses: actions/setup-node@v4 with: node-version: '22' - name: Build, pack, unpack, smoke-test and install the package shell: bash run: bash wai/wai-quantum-js/ci/check.sh "$RUNNER_TEMP/npm"