Skip to content

Commit

Permalink
ENH, CI: Add emscripten to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Nov 11, 2022
1 parent 1a397b3 commit fddb8a3
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/emscripten.yml
@@ -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

0 comments on commit fddb8a3

Please sign in to comment.