From 19d15c37e3cb82ddce55f4eb3946b116ba70781e Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Mon, 13 Oct 2025 21:22:59 +0200 Subject: [PATCH 1/2] Specify wasm-toolchain option --- .github/workflows/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33d1239..0a1421f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,11 @@ on: description: Rust packages to build with a wasm target, e.g. `["package", "package2"]`. required: false type: string + wasm-toolchain: + description: The Rust toolchain for wasm builds, e.g. "nightly-2025-02-16" + required: false + type: string + default: 'default' idl-packages: description: Packages to generate IDLS from, e.g. `["package", "package2"]` required: false @@ -163,14 +168,18 @@ jobs: - name: Setup Environment uses: solana-program/actions/setup-ubuntu@main with: - default-toolchain: true + default-toolchain: ${{ inputs.wasm-toolchain == 'default' }} + nightly-toolchain: ${{ inputs.wasm-toolchain != 'default' && inputs.wasm-toolchain }} cargo-cache-key: cargo-wasm-${{ matrix.package }} - name: Install wasm target - run: rustup target add wasm32-unknown-unknown - - - name: Build with wasm target - run: make build-wasm-${{ matrix.package }} + shell: bash + run: | + if [[ "${{ inputs.wasm-toolchain }}" == "default" ]]; then + rustup target add wasm32-unknown-unknown + else + rustup target add wasm32-unknown-unknown --toolchain "${{ inputs.wasm-toolchain }}" + fi # The test jobs rely on this being successful, so we have to do the "if" check # at every step if `sbpf-program-packages` isn't specified. From 7e90757b3ed077de770cd829bb127f150da3d887 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Tue, 14 Oct 2025 09:57:56 +0200 Subject: [PATCH 2/2] Add wasm target build --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a1421f..662cbe4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -181,6 +181,9 @@ jobs: rustup target add wasm32-unknown-unknown --toolchain "${{ inputs.wasm-toolchain }}" fi + - name: Build with wasm target + run: make build-wasm-${{ matrix.package }} + # The test jobs rely on this being successful, so we have to do the "if" check # at every step if `sbpf-program-packages` isn't specified. build_sbpf: