Skip to content

Commit a6ef189

Browse files
committed
Merge the pyodide CI workflow into the main workflow
1 parent 4dfaf9a commit a6ef189

File tree

3 files changed

+106
-64
lines changed

3 files changed

+106
-64
lines changed

.github/workflows/buildwheel.yml

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,114 @@ on: [push, pull_request]
44

55
jobs:
66
build_wheels:
7-
name: Build wheels for ${{ matrix.os }}
7+
name: ${{ matrix.name }}
88
runs-on: ${{ matrix.os }}
99
continue-on-error: true
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, windows-11-arm, macos-15-intel, macos-14]
13+
include:
14+
- name: Build manylinux x86-64 wheels
15+
os: ubuntu-22.04
16+
kind: native
17+
artifact_name: wheels-ubuntu-22.04
18+
cibw_platform: auto
19+
cibw_build: "*"
20+
- name: Build manylinux arm64 wheels
21+
os: ubuntu-22.04-arm
22+
kind: native
23+
artifact_name: wheels-ubuntu-22.04-arm
24+
cibw_platform: auto
25+
cibw_build: "*"
26+
- name: Build Windows x86-64 wheels
27+
os: windows-2022
28+
kind: native
29+
artifact_name: wheels-windows-2022
30+
cibw_platform: auto
31+
cibw_build: "*"
32+
- name: Build Windows arm64 wheels
33+
os: windows-11-arm
34+
kind: native
35+
artifact_name: wheels-windows-11-arm
36+
cibw_platform: auto
37+
cibw_build: "*"
38+
- name: Build macOS x86-64 wheels
39+
os: macos-15-intel
40+
kind: native
41+
artifact_name: wheels-macos-15-intel
42+
cibw_platform: auto
43+
cibw_build: "*"
44+
- name: Build macOS arm64 wheels
45+
os: macos-14
46+
kind: native
47+
artifact_name: wheels-macos-14
48+
cibw_platform: auto
49+
cibw_build: "*"
50+
- name: Build Pyodide wheels
51+
os: ubuntu-22.04
52+
kind: pyodide
53+
artifact_name: wheels-pyodide
54+
emscripten_version: 4.0.9
55+
cibw_platform: pyodide
56+
cibw_build: cp313-*
1457

1558
steps:
1659
- uses: actions/checkout@v6.0.2
1760

18-
- uses: actions/setup-python@v6
61+
- if: ${{ matrix.kind == 'native' }}
62+
uses: actions/setup-python@v6
1963
with:
2064
python-version: '3.13'
2165

22-
- uses: msys2/setup-msys2@v2.30.0
66+
# -------------- Windows stuff ---------------- #
67+
68+
- if: ${{ matrix.os == 'windows-2022' }}
69+
uses: msys2/setup-msys2@v2.30.0
2370
with:
2471
msystem: ucrt64
2572
update: true
26-
if: ${{ matrix.os == 'windows-2022' }}
2773

28-
- uses: msys2/setup-msys2@v2.30.0
74+
- if: ${{ matrix.os == 'windows-11-arm' }}
75+
uses: msys2/setup-msys2@v2.30.0
2976
with:
3077
msystem: clangarm64
3178
update: true
32-
if: ${{ matrix.os == 'windows-11-arm' }}
3379

3480
# Install pkgconfig on Windows from choco rather than from msys and
3581
# avoid using the Strawberry one.
36-
- run: choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
37-
if: ${{ startsWith( matrix.os , 'windows' ) }}
82+
- if: ${{ startsWith( matrix.os , 'windows' ) }}
83+
run: choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
3884

3985
# We have to set this here rather than in the cibuildwheel config
4086
# This is probably something to do with \ vs / in paths...
41-
- run: |
87+
- if: ${{ startsWith( matrix.os , 'windows' ) }}
88+
run: |
4289
$pkgConfigPath = "${{ github.workspace }}/.local/lib/pkgconfig"
4390
$pkgConfigPath = $pkgConfigPath.Replace('\', '/')
4491
echo "PKG_CONFIG_PATH=$pkgConfigPath" >> $env:GITHUB_ENV
45-
if: ${{ startsWith( matrix.os , 'windows' ) }}
92+
93+
# ------------- pyodide ------------- #
94+
95+
- if: ${{ matrix.kind == 'pyodide' }}
96+
name: Set up Emscripten toolchain
97+
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
98+
with:
99+
version: ${{ matrix.emscripten_version }}
100+
actions-cache-folder: emsdk-cache
101+
102+
# ------------- actual build ------------- #
46103

47104
- name: Build wheels
48105
uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
49106
env:
107+
CIBW_PLATFORM: ${{ matrix.cibw_platform }}
108+
CIBW_BUILD: ${{ matrix.cibw_build }}
50109
# override setting in pyproject.toml to use msys2 instead of msys64 bash
51110
CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }}
52111

53112
- uses: actions/upload-artifact@v7
54113
with:
55-
name: wheels-${{ matrix.os }}
114+
name: ${{ matrix.artifact_name }}
56115
path: wheelhouse/*.whl
57116

58117
build_sdist:
@@ -120,6 +179,37 @@ jobs:
120179
121180
- run: python -m flint.test --verbose
122181

182+
test_pyodide:
183+
needs: build_wheels
184+
name: Test Pyodide wheel
185+
runs-on: ubuntu-22.04
186+
env:
187+
PYODIDE_VERSION: 0.28.2
188+
189+
steps:
190+
- uses: actions/setup-python@v6
191+
with:
192+
python-version: '3.13'
193+
194+
- uses: actions/setup-node@v6
195+
with:
196+
node-version: '22'
197+
198+
- run: pip install "pyodide-build==${{ env.PYODIDE_VERSION }}"
199+
- run: pyodide xbuildenv install "${{ env.PYODIDE_VERSION }}"
200+
201+
- uses: actions/download-artifact@v8
202+
with:
203+
name: wheels-pyodide
204+
path: wheelhouse
205+
206+
- run: |
207+
pyodide venv .venv-pyodide
208+
source .venv-pyodide/bin/activate
209+
pip install wheelhouse/*.whl
210+
pip install pytest hypothesis
211+
python -m pytest -svra -p no:cacheprovider --pyargs flint
212+
123213
# On new enough Ubuntu we can build against the system deb.
124214
test_pip_flint_deb:
125215
name: Build on ${{ matrix.os }}

.github/workflows/ci-emscripten.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

pyproject.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ repair-wheel-command = [
181181
before-all = "bin/cibw_before_all_pyodide.sh"
182182
before-build = "pip install wheel"
183183

184-
# This needs to be kept in sync with EMSCRIPTEN_VERSION and CIBW_BUILD in
185-
# .github.workflows/ci-emscripten.yml. The pyodide version pins both an
186-
# emscripten version and a CPython minor version. Not sure what is a good link
187-
# to see a table of versions but the command pyodide xbuildenv search --all
188-
# shows this.
184+
# This needs to be kept in sync with the Pyodide row in
185+
# .github/workflows/buildwheel.yml. The Pyodide version pins both an
186+
# Emscripten version and a CPython minor version. The command
187+
# `pyodide xbuildenv search --all` shows the compatible combinations.
189188
pyodide-version = "0.28.2"
190189

191190
# GMP, MPFR, and FLINT are built as static libraries for Pyodide.
@@ -201,8 +200,6 @@ repair-wheel-command = [
201200
""",
202201
"cp \"{wheel}\" \"{dest_dir}\"",
203202
]
204-
test-command = "python -m pytest -svra -p no:cacheprovider --pyargs flint"
205-
test-requires = ["pytest", "hypothesis"]
206203

207204
[tool.cibuildwheel.pyodide.environment]
208205
WASM_LIBRARY_DIR = "$(pwd)/wasm-library-dir"

0 commit comments

Comments
 (0)