Use cibuildwheel to build pyodide wheels #258
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Pyodide CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| FORCE_COLOR: 3 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| # cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| PYTHON_VERSION: 3.13 # any 3.13.x version works | |
| EMSCRIPTEN_VERSION: 4.0.9 | |
| NODE_VERSION: 22 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Set up Emscripten toolchain | |
| uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
| with: | |
| version: ${{ env.EMSCRIPTEN_VERSION }} | |
| actions-cache-folder: emsdk-cache | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Restore WASM library directory from cache | |
| id: cache-wasm-library-dir | |
| uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ${{ github.workspace }}/wasm-library-dir | |
| key: wasm-library-dir-${{ hashFiles('pyproject.toml', 'bin/cibw_before_all_pyodide.sh', 'bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0 | |
| - name: Build and test Pyodide wheel | |
| uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 | |
| env: | |
| CIBW_PLATFORM: pyodide | |
| CIBW_BUILD: cp313-* | |
| - name: Persist WASM library directory to cache | |
| if: steps.cache-wasm-library-dir.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ${{ github.workspace }}/wasm-library-dir | |
| key: wasm-library-dir-${{ hashFiles('pyproject.toml', 'bin/cibw_before_all_pyodide.sh', 'bin/pyodide_build_dependencies.sh', 'bin/build_variables.sh') }}-0 | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-pyodide | |
| path: wheelhouse/*.whl |