6
6
- main
7
7
- maintenance/**
8
8
# Note: this workflow gets triggered on the same schedule as the
9
- # wheels.yml workflow, with the exception that this workflow runs
10
- # the test suite for the Pyodide wheel too, prior to uploading it.
11
- #
12
- # Run on schedule to upload to Anaconda.org
9
+ # wheels.yml workflow to upload WASM wheels to Anaconda.org.
13
10
schedule :
14
11
# ┌───────────── minute (0 - 59)
15
12
# │ ┌───────────── hour (0 - 23)
@@ -36,86 +33,30 @@ concurrency:
36
33
cancel-in-progress : true
37
34
38
35
permissions :
39
- contents : read # to fetch code (actions/checkout)
36
+ contents : read # to fetch code (actions/checkout)
40
37
41
38
jobs :
42
39
build-wasm-emscripten :
43
40
name : Build NumPy distribution for Pyodide
44
41
runs-on : ubuntu-22.04
45
42
# To enable this workflow on a fork, comment out:
46
43
if : github.repository == 'numpy/numpy'
47
- env :
48
- PYODIDE_VERSION : 0.26.0
49
- # PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
50
- # The appropriate versions can be found in the Pyodide repodata.json
51
- # "info" field, or in Makefile.envs:
52
- # https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
53
- PYTHON_VERSION : 3.12.1
54
- EMSCRIPTEN_VERSION : 3.1.58
55
- NODE_VERSION : 18
56
44
steps :
57
45
- name : Checkout NumPy
58
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
59
47
with :
60
48
submodules : recursive
61
- # This input shall fetch tags without the need to fetch the
62
- # entire VCS history, see https://github.com/actions/checkout#usage
63
49
fetch-tags : true
64
50
65
- - name : Set up Python ${{ env.PYTHON_VERSION }}
66
- id : setup-python
67
- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
68
- with :
69
- python-version : ${{ env.PYTHON_VERSION }}
51
+ - uses : pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
52
+ env :
53
+ CIBW_PLATFORM : pyodide
70
54
71
- - name : Set up Emscripten toolchain
72
- uses : mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
55
+ - name : Upload wheel artifact(s)
56
+ uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
73
57
with :
74
- version : ${{ env.EMSCRIPTEN_VERSION }}
75
- actions-cache-folder : emsdk-cache
76
-
77
- - name : Install pyodide-build
78
- run : pip install pyodide-build==${{ env.PYODIDE_VERSION }}
79
-
80
- - name : Find installation for pyodide-build
81
- shell : python
82
- run : |
83
- import os
84
- import pyodide_build
85
- from pathlib import Path
86
-
87
- pyodide_build_path = Path(pyodide_build.__file__).parent
88
-
89
- env_file = os.getenv('GITHUB_ENV')
90
-
91
- with open(env_file, "a") as myfile:
92
- myfile.write(f"PYODIDE_BUILD_PATH={pyodide_build_path}\n")
93
-
94
- - name : Build NumPy for Pyodide
95
- run : |
96
- pyodide build \
97
- -Cbuild-dir=build \
98
- -Csetup-args="--cross-file=$PWD/tools/ci/emscripten/emscripten.meson.cross" \
99
- -Csetup-args="-Dblas=none" \
100
- -Csetup-args="-Dlapack=none"
101
-
102
- - name : Set up Node.js
103
- uses : actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
104
- with :
105
- node-version : ${{ env.NODE_VERSION }}
106
-
107
- - name : Set up Pyodide virtual environment
108
- run : |
109
- pyodide venv .venv-pyodide
110
- source .venv-pyodide/bin/activate
111
- pip install dist/*.whl
112
- pip install -r requirements/emscripten_test_requirements.txt
113
-
114
- - name : Test NumPy for Pyodide
115
- run : |
116
- source .venv-pyodide/bin/activate
117
- cd ..
118
- pytest --pyargs numpy -m "not slow"
58
+ name : cp312-pyodide_wasm32
59
+ path : ./wheelhouse/*.whl
119
60
120
61
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
121
62
# WARNING: this job will overwrite any existing WASM wheels.
124
65
(github.repository == 'numpy/numpy') &&
125
66
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
126
67
(github.event_name == 'schedule')
127
- uses : scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
68
+ uses : scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
128
69
with :
129
- artifacts_path : dist /
70
+ artifacts_path : wheelhouse /
130
71
anaconda_nightly_upload_token : ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
0 commit comments