Skip to content

Commit 26eda59

Browse files
committed
FEAT add wasm wheel in cibw
1 parent 4e55ef8 commit 26eda59

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
call-test:
1212
uses: ./.github/workflows/test.yml
1313
secrets: inherit
14+
15+
build-wasm-wheel:
16+
needs: call-test
17+
uses: ./.github/workflows/emscripten.yml
1418

1519
build-sdist:
1620
runs-on: ubuntu-latest

.github/workflows/emscripten.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Emscripten/Pyodide build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-wasm-wheels:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Build WSAM wheel
12+
uses: pypa/[email protected]
13+
env:
14+
CIBW_PLATFORM: pyodide
15+
SKLEARN_SKIP_OPENMP_TEST: "true"
16+
SKLEARN_SKIP_NETWORK_TESTS: 1
17+
# -s pytest argument is needed to avoid an issue in pytest output capturing with Pyodide
18+
CIBW_TEST_COMMAND: "python -m pytest -svra --pyargs tests --durations 20 --showlocals"
19+
- name: Upload package
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: wasm_wheel
23+
path: wasm/*.whl
24+
if-no-files-found: error

.github/workflows/publish-pypi.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@ jobs:
2424

2525
- name: Publish distribution to PyPI
2626
uses: pypa/gh-action-pypi-publish@release/v1
27+
28+
- name: get wasm dist artifacts
29+
uses: actions/download-artifact@v4
30+
with:
31+
name: wasm_wheel
32+
path: wasm/
33+
34+
- name: upload to github release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
files: |
38+
wasm/*.whl
39+
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}

0 commit comments

Comments
 (0)