@@ -15,93 +15,42 @@ jobs:
1515 build :
1616 runs-on : ubuntu-latest
1717 env :
18- PYODIDE_VERSION : " https://github.com/pyodide/pyodide-build-environment-nightly/releases/download/20250523-emscripten_4.0.9/xbuildenv.tar.bz2"
1918 PYTHON_VERSION : 3.13 # any 3.13.x version works
20- EMSCRIPTEN_VERSION : 4.0.9
2119 NODE_VERSION : 22
2220 steps :
23- - uses : actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2 .2
21+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0 .2
2422
2523 - name : Set up Python ${{ env.PYTHON_VERSION }}
26- uses : actions/setup-python@2e3e4b15a884dc73a63f962bff250a855150a234 # v5.4.0
24+ uses : actions/setup-python@v6
2725 with :
2826 python-version : ${{ env.PYTHON_VERSION }}
2927
30- - name : Set up Emscripten toolchain
31- uses : mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
32- with :
33- version : ${{ env.EMSCRIPTEN_VERSION }}
34- actions-cache-folder : emsdk-cache
35-
3628 - name : Set up Node.js
37- uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
29+ uses : actions/setup-node@v6
3830 with :
3931 node-version : ${{ env.NODE_VERSION }}
4032
41- - name : Install pyodide-build
42- run : |
43- pip install pyodide-build
44- pyodide xbuildenv install --url ${{ env.PYODIDE_VERSION }}
45-
4633 - name : Restore WASM library directory from cache
4734 id : cache-wasm-library-dir
4835 uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
4936 with :
5037 path : ${{ github.workspace }}/wasm-library-dir
51- key : wasm-library-dir-${{ hashFiles('bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0
38+ key : wasm-library-dir-${{ hashFiles('pyproject.toml', 'bin/cibw_before_all_pyodide.sh', ' bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0
5239
53- - name : Build GMP, MPFR and FLINT
54- if : steps.cache-wasm-library-dir.outputs.cache-hit != 'true'
40+ - name : Build and test Pyodide wheel
41+ uses : pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1
5542 env :
56- CFLAGS : " -fPIC "
57- run : bin/pyodide_build_dependencies.sh --wasm-library-dir ${{ github.workspace }}/wasm-library-dir
43+ CIBW_PLATFORM : pyodide
44+ CIBW_BUILD : cp313-*
5845
5946 - name : Persist WASM library directory to cache
47+ if : steps.cache-wasm-library-dir.outputs.cache-hit != 'true'
6048 uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
6149 with :
6250 path : ${{ github.workspace }}/wasm-library-dir
63- key : wasm-library-dir-${{ hashFiles('bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0
64-
65- - name : Restore python-flint build directory from cache
66- uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
67- with :
68- path : ${{ github.workspace }}/flint_wasm_build
69- key : flint-wasm-build-${{ hashFiles('**/meson.build', '**/pyproject.toml', '**/setup.py') }}
70-
71- - name : Build python-flint
72- env :
73- WASM_LIBRARY_DIR : ${{ github.workspace }}/wasm-library-dir
74- run : |
75- export PKG_CONFIG_PATH="${{ env.WASM_LIBRARY_DIR }}/lib/pkgconfig:${PKG_CONFIG_PATH}"
76- export CFLAGS="-I${{ env.WASM_LIBRARY_DIR }}/include ${CFLAGS:-}"
77- export LDFLAGS="-L${{ env.WASM_LIBRARY_DIR }}/lib -lflint -lmpfr -lgmp ${LDFLAGS:-}"
78-
79- echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
80- echo "CFLAGS=${CFLAGS}"
81- echo "LDFLAGS=${LDFLAGS}"
82-
83- pkg-config --modversion python3
84- pkg-config --modversion mpfr
85- pkg-config --modversion flint
51+ key : wasm-library-dir-${{ hashFiles('pyproject.toml', 'bin/cibw_before_all_pyodide.sh', 'bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0
8652
87- pyodide build -Cbuild-dir=flint_wasm_build -Csetup-args="-Dflint_version_check=false"
88-
89- - name : Persist python-flint build directory to cache
90- uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
53+ - uses : actions/upload-artifact@v7
9154 with :
92- path : ${{ github.workspace }}/flint_wasm_build
93- key : flint-wasm-build-${{ hashFiles('**/meson.build', '**/pyproject.toml', '**/setup.py') }}
94-
95- - name : Set up Pyodide virtual environment and test python-flint
96- run : |
97- pyodide venv .venv-pyodide
98-
99- source .venv-pyodide/bin/activate
100- pip install dist/*.whl
101-
102- cd doc
103-
104- pip install pytest hypothesis
105- # Don't use the cache provider plugin, as it doesn't work with Pyodide
106- # right now: https://github.com/pypa/cibuildwheel/issues/1966
107- pytest -svra -p no:cacheprovider --pyargs flint
55+ name : wheels-pyodide
56+ path : wheelhouse/*.whl
0 commit comments