-
Notifications
You must be signed in to change notification settings - Fork 28
89 lines (81 loc) · 3.62 KB
/
wasm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Wasm build and test
on:
push:
branches:
- "**" # target all branches
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
RUST_BACKTRACE: full
jobs:
wasm_with_nodejs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Update local dependency repositories
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential python3 python3-toml podman build-essential pkg-config libssl-dev
- name: Install rust deps
run: sudo apt-get install -yqq build-essential pkg-config libssl-dev
- uses: actions/checkout@v3
- name: Install rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(python3 ./build-tools/rust-version-extractor/rust-version-extractor.py)
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build the wasm module
working-directory: ./wasm-wrappers
run: wasm-pack build --target nodejs
- name: Run the tests
working-directory: ./wasm-wrappers
run: node js-bindings/node-entry.js
wasm_artifacts:
runs-on: ubuntu-latest
steps:
- name: Update local dependency repositories
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential python3 python3-toml podman build-essential pkg-config libssl-dev
- name: Install rust deps
run: sudo apt-get install -yqq build-essential pkg-config libssl-dev
- uses: actions/checkout@v3
- name: Install rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $(python3 ./build-tools/rust-version-extractor/rust-version-extractor.py)
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build the wasm module for nodejs - release
working-directory: ./wasm-wrappers
run: wasm-pack build --target nodejs --out-dir wasm-wrappers-builds/nodejs/release --release
- name: Build the wasm module for nodejs - debug
working-directory: ./wasm-wrappers
run: wasm-pack build --target nodejs --out-dir wasm-wrappers-builds/nodejs/debug --debug
- name: Build the wasm module for web - release
working-directory: ./wasm-wrappers
run: wasm-pack build --target web --out-dir wasm-wrappers-builds/web/release --release
- name: Build the wasm module for web - debug
working-directory: ./wasm-wrappers
run: wasm-pack build --target web --out-dir wasm-wrappers-builds/web/debug --debug
- name: Build the wasm module for bundler - release
working-directory: ./wasm-wrappers
run: wasm-pack build --target bundler --out-dir wasm-wrappers-builds/bundler/release --release
- name: Build the wasm module for bundler - debug
working-directory: ./wasm-wrappers
run: wasm-pack build --target bundler --out-dir wasm-wrappers-builds/bundler/debug --debug
- name: Copy readme file into the package
working-directory: ./wasm-wrappers
run: cp README.md wasm-wrappers-builds/ && cp WASM-API.md wasm-wrappers-builds/
- name: Create artifacts
uses: actions/upload-artifact@v4
with:
name: wasm_builds
path: |
./wasm-wrappers/wasm-wrappers-builds