Skip to content

Commit 55c55f7

Browse files
authored
Merge pull request #1497 from o1-labs/dw/add-build-wasm-ci
CI/tests: add build-wasm
2 parents 53f2c74 + ac20446 commit 55c55f7

File tree

7 files changed

+41
-3
lines changed

7 files changed

+41
-3
lines changed

.github/workflows/build-macos-13.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
os: macos-13
1717
cache-prefix: macos-13-
1818
build-wasm: true
19+
rustflags: "-C link-args=-Wl,-undefined,dynamic_lookup"

.github/workflows/build-macos-14.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
os: macos-14
1717
cache-prefix: macos-14-
1818
build-wasm: true
19+
rustflags: "-C link-args=-Wl,-undefined,dynamic_lookup"

.github/workflows/build-macos-15.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
os: macos-15
1717
cache-prefix: macos-15-
1818
build-wasm: true
19+
rustflags: "-C link-args=-Wl,-undefined,dynamic_lookup"

.github/workflows/build-macos-latest.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
os: macos-latest
1717
cache-prefix: macos-latest-
1818
build-wasm: true
19+
rustflags: "-C link-args=-Wl,-undefined,dynamic_lookup"

.github/workflows/build-reusable.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,25 @@ on:
2222
type: boolean
2323
default: false
2424
description: "Whether to build WASM targets"
25+
rustflags:
26+
required: false
27+
type: string
28+
default: ""
29+
description: "Additional RUSTFLAGS to append (e.g., macOS-specific linker flags)"
2530

2631
env:
2732
CARGO_TERM_COLOR: always
2833
RUST_BACKTRACE: full
2934
MINA_PANIC_ON_BUG: true
3035
CARGO_INCREMENTAL: 1
31-
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off -C link-args=-Wl,-undefined,dynamic_lookup"
36+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
3237

3338
jobs:
3439
build:
3540
timeout-minutes: 60
3641
runs-on: ${{ inputs.os }}
42+
env:
43+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}"
3744
steps:
3845
- name: Git checkout
3946
uses: actions/checkout@v5
@@ -75,6 +82,8 @@ jobs:
7582
build-tests:
7683
timeout-minutes: 60
7784
runs-on: ${{ inputs.os }}
85+
env:
86+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}"
7887
steps:
7988
- name: Git checkout
8089
uses: actions/checkout@v5
@@ -99,6 +108,8 @@ jobs:
99108
build-tests-webrtc:
100109
timeout-minutes: 60
101110
runs-on: ${{ inputs.os }}
111+
env:
112+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}"
102113
steps:
103114
- name: Git checkout
104115
uses: actions/checkout@v5
@@ -144,4 +155,4 @@ jobs:
144155
- name: Release build
145156
run: make build-wasm
146157
env:
147-
RUSTFLAGS: ""
158+
RUSTFLAGS: ""

.github/workflows/tests.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
RUST_BACKTRACE: full
1717
MINA_PANIC_ON_BUG: true
1818
CARGO_INCREMENTAL: 1
19-
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off -C link-args=-Wl,-undefined,dynamic_lookup"
19+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
2020

2121
concurrency:
2222
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -284,6 +284,27 @@ jobs:
284284
path: target/release/tests
285285
retention-days: 7
286286

287+
build-wasm:
288+
timeout-minutes: 60
289+
runs-on: ubuntu-22.04
290+
steps:
291+
- name: Git checkout
292+
uses: actions/checkout@v5
293+
294+
- name: Setup build dependencies
295+
uses: ./.github/actions/setup-build-deps
296+
297+
- name: Setup Rust
298+
uses: ./.github/actions/setup-rust
299+
with:
300+
toolchain: nightly
301+
cache-prefix: build-wasm-v0
302+
303+
- name: Setup wasm tooling
304+
run: make setup-wasm
305+
306+
- name: Build WebAssembly node
307+
run: make build-wasm
287308

288309
p2p-scenario-tests:
289310
needs: [build-tests, build-tests-webrtc]

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6060
([#1513](https://github.com/o1-labs/mina-rust/pull/1513))
6161
- **scan_state**: refactorize `transaction_logic.rs` in smaller modules
6262
([#1515](https://github.com/o1-labs/mina-rust/pull/1515))
63+
- **CI/tests**: run the step `build-wasm` for each push and PR to `develop`
64+
([#1497](https://github.com/o1-labs/mina-rust/pull/1497))
6365

6466
## v0.17.0
6567

0 commit comments

Comments
 (0)