name: Setup test environment
description: >
Everything ./test.sh needs (Node.js, stable Rust, wasm-pack,
cargo-expand), plus a fresh dependency resolution: Cargo.lock is
gitignored, so every run resolves the latest compatible versions —
what downstream users actually get.
outputs:
wasm-bindgen-version:
description: The wasm-bindgen version this run resolved.
value: ${{ steps.resolve.outputs.wasm_bindgen }}
runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Install toolchain
shell: bash
run: rustup toolchain install stable --profile minimal --component rustfmt --override
- name: Install wasm-pack
uses: jetli/wasm-pack-action@v0.4.0
with:
version: v0.14.0
- name: Add cargo-expand
shell: bash
run: cargo install cargo-expand --version 1.0.124 --locked
- name: Resolve dependencies
id: resolve
shell: bash
run: |
cargo generate-lockfile
WB_VERSION="$(cargo pkgid wasm-bindgen)"
WB_VERSION="${WB_VERSION##*@}"
echo "wasm_bindgen=$WB_VERSION" >> "$GITHUB_OUTPUT"
{
echo "Resolved wasm-bindgen: $WB_VERSION"
rustc --version
} | tee -a "$GITHUB_STEP_SUMMARY"