forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.6 KB
/
emscripten.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
# To enable this workflow on a fork, comment out:
#
# if: github.repository == 'numpy/numpy'
name: Test Emscripten/Pyodide build
on:
pull_request:
branches:
- main
- maintenance/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build-wasm-emscripten:
runs-on: ubuntu-22.04
if: "github.repository == 'numpy/numpy'"
env:
PYODIDE_VERSION: 0.23.1
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
# The appropriate versions can be found in the Pyodide repodata.json
# "info" field, or in Makefile.envs:
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
PYTHON_VERSION: 3.11.2
EMSCRIPTEN_VERSION: 3.1.32
NODE_VERSION: 18
steps:
- name: Checkout numpy
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true
# versioneer.py requires the latest tag to be reachable. Here we
# fetch the complete history to get access to the tags.
# A shallow clone can work when the following issue is resolved:
# https://github.com/actions/checkout/issues/338
fetch-depth: 0
- name: set up python
id: setup-python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- name: Install pyodide-build
run: pip install "pydantic<2" pyodide-build==$PYODIDE_VERSION
- name: Build
run: |
# Pyodide is still in the process of adding better/easier support for
# non-setup.py based builds.
cp pyproject.toml.setuppy pyproject.toml
CFLAGS="-g2 -Wno-error=return-type-c-linkage" LDFLAGS=-g2 pyodide build
- name: set up node
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Pyodide virtual environment
run: |
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install dist/*.whl
pip install -r test_requirements.txt
- name: Test
run: |
source .venv-pyodide/bin/activate
cd ..
python numpy/runtests.py -n -vv