forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 3.11 KB
/
test-pyodide.yaml
File metadata and controls
90 lines (74 loc) · 3.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
# Copied from NumPy https://github.com/numpy/numpy/pull/25894
# https://github.com/numpy/numpy/blob/d2d2c25fa81b47810f5cbd85ea6485eb3a3ffec3/.github/workflows/emscripten.yml
#
name: Test Pyodide
on: [push, pull_request, merge_group]
env:
FORCE_COLOR: 3
PYTEST: "pytest --config-file ${{ github.workspace }}/pyproject.toml"
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:
name: "pyodide${{ matrix.PYODIDE_VERSION }}\
-cp${{ matrix.PYTHON_VERSION }}\
-emscr${{ matrix.EMSCRIPTEN_VERSION }}"
runs-on: ubuntu-24.04
strategy:
# Ensure that wheel builder finishes even if another one fails
fail-fast: false
matrix:
# Use `includes:` if you want to specify other combinations!
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
# The appropriate version combinations can be found in the Pyodide repodata.json
# "info" field, or in Makefile.envs:
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
PYODIDE_VERSION: ["0.29.0"]
PYTHON_VERSION: ["3.13"]
EMSCRIPTEN_VERSION: ["4.0.9"]
NODE_VERSION: ["24"]
PYODIDE_BUILD_VERSION: ["0.30.8"]
steps:
- name: Checkout scikit-image
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.PYTHON_VERSION }}
id: setup-python
uses: actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.0.0
with:
python-version: ${{ matrix.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Set up Emscripten toolchain
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
with:
version: ${{ matrix.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- name: Install pyodide-build
run: pip install pyodide-build==${{ matrix.PYODIDE_BUILD_VERSION }}
- name: Build scikit-image for Pyodide
run: |
pyodide xbuildenv install ${{ matrix.PYODIDE_VERSION }}
pyodide build
- name: Set up Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Set up Pyodide test environment
run: |
# Set up Pyodide virtual environment
pyodide venv .venv-pyodide
# Activate the virtual environment and install the built scikit-image wheel
source .venv-pyodide/bin/activate
pip install dist/*.whl
# Install pytest and optional dependencies that are available
pip install pytest pytest-pretty
pip install "astropy" "dask[array]" "matplotlib" "PyWavelets" "scikit-learn"
- name: Test scikit-image
run: |
source .venv-pyodide/bin/activate
$PYTEST -svra --pyargs skimage ./tests