Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 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/** | ||
|
||
jobs: | ||
build-wasm-emscripten: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'numpy/numpy' | ||
env: | ||
PYODIDE_VERSION: 0.22.0a3 | ||
# 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.10.2 | ||
EMSCRIPTEN_VERSION: 3.1.24 | ||
NODE_VERSION: 18 | ||
steps: | ||
- name: Checkout numpy | ||
uses: actions/checkout@v3 | ||
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@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- uses: mymindstorm/setup-emsdk@v11 | ||
with: | ||
version: ${{ env.EMSCRIPTEN_VERSION }} | ||
actions-cache-folder: emsdk-cache | ||
|
||
- name: Install pyodide-build | ||
run: pip install pyodide-build==$PYODIDE_VERSION | ||
|
||
- name: Build | ||
run: CFLAGS=-g2 LDFLAGS=-g2 pyodide build | ||
|
||
- name: set up node | ||
uses: actions/setup-node@v3 | ||
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 |