Skip to content

Commit f610090

Browse files
committed
Merge #24: Build and test wasm on MacOS in CI
149d686 Build and test wasm on MacOS in CI (rishflab) Pull request description: ACKs for top commit: jonasnick: ACK 149d686 Tree-SHA512: a7a8f414912d2b03cc3a0a328fa33b0f0e3948694b39d5ebefb66b361ca58ec50a2909e82902ae2f1bc737d5305bc8628f0e4aab2e1681203cb23faf6dd6f506
2 parents 2d097c2 + 149d686 commit f610090

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

.github/workflows/rust.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,29 @@ jobs:
2929
DO_BENCH: true
3030
run: ./contrib/test.sh
3131

32-
wasm_pack:
32+
wasm:
3333
name: Stable - Docs / WebAssembly Build
34-
runs-on: ubuntu-latest
3534
strategy:
3635
matrix:
37-
rust:
38-
- stable
36+
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ]
37+
include:
38+
- target: x86_64-unknown-linux-gnu
39+
os: ubuntu-latest
40+
cc: clang-12
41+
ar: ar
42+
- target: x86_64-apple-darwin
43+
os: macos-latest
44+
cc: /usr/local/opt/llvm/bin/clang
45+
ar: /usr/local/opt/llvm/bin/llvm-ar
46+
runs-on: ${{ matrix.os }}
3947
steps:
4048
- name: Checkout Crate
4149
uses: actions/checkout@v2
4250
- name: Checkout Toolchain
4351
uses: actions-rs/toolchain@v1
4452
with:
4553
profile: minimal
46-
toolchain: ${{ matrix.rust }}
54+
toolchain: stable
4755
override: true
4856
- name: Building docs
4957
env:
@@ -54,18 +62,10 @@ jobs:
5462
- name: Running WASM build
5563
env:
5664
DO_WASM: true
65+
CC: ${{ matrix.cc }}
66+
AR: ${{ matrix.ar }}
5767
run: ./contrib/test.sh
5868

59-
build_wasm:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v2
63-
- uses: actions-rs/toolchain@v1
64-
with:
65-
toolchain: stable
66-
target: wasm32-unknown-unknown
67-
- run: cargo build --target wasm32-unknown-unknown --features global-context,use-serde,use-rand
68-
6969
Tests:
7070
name: Tests
7171
strategy:

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ bitcoin_hashes = "0.9"
4545
[target.wasm32-unknown-unknown.dev-dependencies]
4646
wasm-bindgen-test = "0.3"
4747
rand = { version = "0.6", features = ["wasm-bindgen"] }
48+
49+
[lib]
50+
crate-type = ["cdylib", "rlib"]

contrib/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ fi
5353
# Webassembly stuff
5454
if [ "$DO_WASM" = true ]; then
5555
clang --version &&
56-
CC=clang-9 wasm-pack build &&
57-
CC=clang-9 wasm-pack test --node;
56+
wasm-pack build &&
57+
wasm-pack test --node;
5858
fi
5959

6060
# Address Sanitizer

0 commit comments

Comments
 (0)