-
Notifications
You must be signed in to change notification settings - Fork 31
130 lines (101 loc) · 4.11 KB
/
wasm.yml
File metadata and controls
130 lines (101 loc) · 4.11 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Wasm build and test
on:
push:
branches:
- master
pull_request:
branches:
- "**" # target all branches
schedule:
- cron: '15 0 * * *' # every day at 00:15 UTC
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: Checkout the repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Update the list of available system packages
run: sudo apt-get update
- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential pkg-config libssl-dev
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install TypeScript & Knip
run: npm install typescript knip
- name: Install wasm-pack
run: cargo install wasm-pack --locked
- name: Build the wasm module
working-directory: ./wasm-wrappers
run: wasm-pack build --target nodejs
- name: Compile the tests
working-directory: ./wasm-wrappers
run: tsc --project js-bindings-test/tsconfig.json
- name: Run the tests
working-directory: ./wasm-wrappers
run: node --enable-source-maps js-bindings-test/node-entry.js
- name: Run Knip
working-directory: ./wasm-wrappers/js-bindings-test
run: npx knip
wasm_artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v5
with:
submodules: recursive
- name: Update the list of available system packages
run: sudo apt-get update
- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential pkg-config libssl-dev
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)
- name: Install wasm-pack
run: cargo install wasm-pack --locked
- 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