-
Notifications
You must be signed in to change notification settings - Fork 22
67 lines (55 loc) · 1.61 KB
/
emscripten.yaml
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
name: WASM
on:
workflow_dispatch:
pull_request:
branches:
- master
- develop
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wasm-emscripten:
name: Pyodide wheel
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pyodide-build
run: pip install pyodide-build==0.23.4
- name: Compute emsdk version
id: compute-emsdk-version
run: |
# Prepare xbuild environment (side-effect)
pyodide config list
# Save EMSDK version
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT
- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }}
actions-cache-folder: emsdk-cache
- name: Build
run: CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up Pyodide virtual environment
run: |
pyodide venv .venv-pyodide
.venv-pyodide/bin/pip install $(echo -n dist/*.whl)[test]
- name: Test
run: .venv-pyodide/bin/pytest
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: emscripten-wheel
path: dist/*.whl