Skip to content

Commit 764f34e

Browse files
Revamp workflow and clean up changes
1 parent 9271054 commit 764f34e

File tree

1 file changed

+17
-55
lines changed

1 file changed

+17
-55
lines changed

.github/workflows/ci-emscripten.yaml

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ env:
1515
DISABLE_NUMCODECS_AVX2: 1
1616
DISABLE_NUMCODECS_SSE2: 1
1717
# Common environment variables for both build and test jobs
18-
PYODIDE_VERSION: 0.25.1
18+
PYODIDE_VERSION: 0.27.0a2
1919
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
2020
# The appropriate versions can be found in the Pyodide repodata.json
2121
# "info" field, or in Makefile.envs:
2222
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
23-
PYTHON_VERSION: 3.11.3
24-
EMSCRIPTEN_VERSION: 3.1.46
25-
NODE_VERSION: 18
23+
PYTHON_VERSION: 3.12.1
24+
EMSCRIPTEN_VERSION: 3.1.58
25+
NODE_VERSION: 20
2626

2727
concurrency:
2828
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -62,68 +62,30 @@ jobs:
6262
patch -p1 < tools/ci/patches/0002-add-missing-unistd-headers.patch
6363
6464
- name: Install pyodide-build
65-
run: python -m pip install "pydantic<2" "pyodide-build==${{ env.PYODIDE_VERSION }}"
65+
run: python -m pip install pyodide-build
6666

67-
- name: Build numcodecs for Pyodide
68-
run: |
69-
pyodide build
70-
71-
- name: Set up Node.js
72-
uses: actions/setup-node@v4
73-
with:
74-
node-version: ${{ env.NODE_VERSION }}
75-
76-
- name: Upload Pyodide wheel artifact
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: numcodecs-pyodide-wheel
80-
path: dist/*.whl
81-
82-
test-wasm-emscripten:
83-
name: Test numcodecs Pyodide distribution
84-
runs-on: ubuntu-22.04
85-
needs: [build-wasm-emscripten]
86-
steps:
87-
- name: Set up Python ${{ env.PYTHON_VERSION }}
88-
id: setup-python
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: ${{ env.PYTHON_VERSION }}
92-
93-
- name: Checkout necessary patch(es)
94-
uses: actions/checkout@v4
95-
with:
96-
sparse-checkout: tools/ci/patches/0003-fix-npy-file-access.patch
97-
sparse-checkout-cone-mode: false
98-
99-
- name: Set up Emscripten toolchain
100-
uses: mymindstorm/setup-emsdk@v14
101-
with:
102-
version: ${{ env.EMSCRIPTEN_VERSION }}
103-
actions-cache-folder: emsdk-cache
104-
105-
- name: Apply necessary patch(es)
106-
# We just need the third patch to fix the npy file access this time
107-
run: patch -d $EMSDK/upstream/emscripten/ -p1 < tools/ci/patches/0003-fix-npy-file-access.patch
108-
109-
- name: Install pyodide-build
110-
run: python -m pip install "pydantic<2" "pyodide-build==${{ env.PYODIDE_VERSION }}"
67+
- name: Build numcodecs for Pyodide/WASM
68+
run: pyodide build
11169

11270
- name: Set up Node.js
11371
uses: actions/setup-node@v4
11472
with:
11573
node-version: ${{ env.NODE_VERSION }}
11674

117-
- name: Download Pyodide wheel artifact
118-
uses: actions/download-artifact@v4
119-
with:
120-
path: dist
121-
merge-multiple: true
122-
12375
- name: Set up Pyodide virtual environment and test numcodecs for Pyodide
12476
run: |
77+
# Pin to a specific version of Pyodide to ensure reliability
78+
pyodide xbuildenv install ${{ env.PYODIDE_VERSION }}
79+
80+
# Set up Pyodide virtual environment and activate it
12581
pyodide venv .venv-pyodide
12682
source .venv-pyodide/bin/activate
83+
84+
# Install the built numcodecs WASM package
12785
python -m pip install dist/*.whl
12886
python -m pip install pytest pytest-cov coverage
87+
88+
# Change into a different directory before running tests to avoid
89+
# the test runner picking up the local numcodecs package
90+
cd docs
12991
python -m pytest --pyargs numcodecs

0 commit comments

Comments
 (0)