Skip to content

Commit 3d4cb8c

Browse files
authored
Merge pull request #1445 from o1-labs/dw/setup-wasm-install-wasmbindgen
CI/Makefile: setup-wasm installs wasm-bindgen-cli
2 parents 378c710 + 3939b14 commit 3d4cb8c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/actions/setup-wasm/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ inputs:
55
description: 'Rust toolchain version'
66
required: false
77
default: 'nightly'
8-
wasm-bindgen-version:
9-
description: 'wasm-bindgen-cli version'
10-
required: false
11-
default: '0.2.99'
128
cache-prefix:
139
description: 'Cache prefix key'
1410
required: false
@@ -20,13 +16,11 @@ runs:
2016
uses: dtolnay/rust-toolchain@stable
2117
with:
2218
toolchain: ${{ inputs.toolchain }}
23-
components: rustfmt, rust-src
2419

25-
- name: Install wasm32 target and wasm-bindgen-cli
20+
- name: Setup WASM toolchain using Makefile
2621
shell: bash
2722
run: |
28-
rustup target add wasm32-unknown-unknown
29-
cargo install -f wasm-bindgen-cli --version ${{ inputs.wasm-bindgen-version }}
23+
make setup-wasm
3024
3125
- name: Setup Rust Cache
3226
uses: Swatinem/rust-cache@v2

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# - ./github/workflows/lint.yaml
99
NIGHTLY_RUST_VERSION = "nightly"
1010

11+
# WebAssembly
12+
WASM_BINDGEN_CLI_VERSION = "0.2.99"
13+
1114
# Docker
1215
DOCKER_ORG ?= o1labs
1316

@@ -240,8 +243,8 @@ lint-dockerfiles: ## Check all Dockerfiles using hadolint
240243
fi; \
241244
fi
242245

243-
.PHONY: setup-wasm-toolchain
244-
setup-wasm-toolchain: ## Setup the WebAssembly toolchain, using nightly
246+
.PHONY: setup-wasm
247+
setup-wasm: ## Setup the WebAssembly toolchain, using nightly
245248
@ARCH=$$(uname -m); \
246249
OS=$$(uname -s | tr A-Z a-z); \
247250
case $$OS in \
@@ -256,8 +259,11 @@ setup-wasm-toolchain: ## Setup the WebAssembly toolchain, using nightly
256259
*) echo "Unsupported architecture: $$ARCH" && exit 1 ;; \
257260
esac; \
258261
TARGET="$$ARCH_PART-$$OS_PART"; \
259-
echo "Installing rust-src and rustfmt for ${NIGHTLY_RUST_VERSION}-$$TARGET with wasm32 target"; \
260-
rustup target add wasm32-unknown-unknown --toolchain ${NIGHTLY_RUST_VERSION}-$$TARGET
262+
echo "Installing components for ${NIGHTLY_RUST_VERSION}-$$TARGET with wasm32 target"; \
263+
rustup component add rust-src --toolchain ${NIGHTLY_RUST_VERSION}-$$TARGET; \
264+
rustup component add rustfmt --toolchain ${NIGHTLY_RUST_VERSION}-$$TARGET; \
265+
rustup target add wasm32-unknown-unknown --toolchain ${NIGHTLY_RUST_VERSION}-$$TARGET; \
266+
cargo install wasm-bindgen-cli --version ${WASM_BINDGEN_CLI_VERSION}
261267

262268
.PHONY: test
263269
test: ## Run tests

0 commit comments

Comments
 (0)