-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use cibuildwheel for pyodide test
Signed-off-by: Henry Schreiner <[email protected]>
- Loading branch information
Showing
5 changed files
with
39 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,51 +17,9 @@ env: | |
SOURCE_DATE_EPOCH: "1668811211" | ||
|
||
jobs: | ||
pyodide-python-version: | ||
name: Determine Pyodide Python version | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
python-version: ${{ steps.retrieve-python-version.outputs.python-version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Cache python version | ||
id: cache-pyodide-python-version | ||
uses: actions/cache@v4 | ||
with: | ||
path: pyodide-python-version | ||
key: ${{ runner.os }}-docs-pyodide-python-version-${{ hashFiles('docs/requirements-wasm.txt') }} | ||
|
||
- name: Setup Python | ||
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true' | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "${{ env.X86_64_PYTHON_VERSION }}" | ||
|
||
- name: Install dependencies | ||
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true' | ||
run: python3 -m pip install -r docs/requirements-wasm.txt | ||
|
||
- name: Determine Python version | ||
if: steps.cache-pyodide-python-version.outputs.cache-hit != 'true' | ||
id: compute-python-version | ||
run: | | ||
# Save Python version | ||
PYTHON_VERSION=$(pyodide config get python_version) | ||
echo $PYTHON_VERSION > pyodide-python-version | ||
- name: Retrieve Python version | ||
id: retrieve-python-version | ||
run: | | ||
PYTHON_VERSION=$(cat pyodide-python-version) | ||
echo "python-version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT" | ||
awkward-cpp-wasm: | ||
name: Build C++ WASM | ||
runs-on: ubuntu-22.04 | ||
needs: [pyodide-python-version] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -70,53 +28,24 @@ jobs: | |
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "${{ needs.pyodide-python-version.outputs.python-version }}" | ||
python-version: "3.12" | ||
|
||
- name: Generate build files | ||
run: pipx run nox -s prepare -- --headers --signatures | ||
|
||
- name: Cache wheel | ||
id: cache-awkward-cpp-wasm-wheel | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./awkward-cpp/dist | ||
key: ${{ runner.os }}-"${{ needs.pyodide-python-version.outputs.python-version }}-awkward-cpp-wasm-${{ hashFiles('awkward-cpp/**') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true' | ||
run: python3 -m pip install -r docs/requirements-wasm.txt | ||
|
||
- name: Determine EMSDK version | ||
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true' | ||
id: compute-emsdk-version | ||
run: | | ||
# Prepare xbuild environment (side-effect) | ||
pyodide config list | ||
# Save EMSDK version | ||
EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) | ||
echo "emsdk-version=$EMSCRIPTEN_VERSION" >> $GITHUB_OUTPUT | ||
working-directory: awkward-cpp | ||
|
||
- name: Install EMSDK | ||
uses: mymindstorm/setup-emsdk@v14 | ||
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true' | ||
- uses: pypa/[email protected] | ||
with: | ||
version: ${{ steps.compute-emsdk-version.outputs.emsdk-version }} | ||
|
||
- name: Build wheel | ||
if: steps.cache-awkward-cpp-wasm-wheel.outputs.cache-hit != 'true' | ||
id: build-awkward-cpp-wasm-wheel | ||
run: | | ||
# pyodide-build doesn't work out of the box with pipx | ||
CFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive | ||
working-directory: awkward-cpp | ||
package-dir: awkward-cpp | ||
env: | ||
CIBW_PLATFORM: pyodide | ||
|
||
- name: Upload wheel | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: awkward-cpp-wasm | ||
path: awkward-cpp/dist/awkward*wasm32.whl | ||
|
||
|
||
awkward-cpp-x86-64: | ||
runs-on: ubuntu-22.04 | ||
name: Build C++ x86 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,15 +73,13 @@ jobs: | |
CIBW_ARCHS_MACOS: universal2 | ||
CIBW_BUILD: cp39-win_amd64 cp310-manylinux_x86_64 cp38-macosx_universal2 | ||
with: | ||
config-file: cibuildwheel.toml | ||
package-dir: awkward-cpp | ||
|
||
- uses: pypa/[email protected] | ||
if: matrix.os == 'ubuntu-latest' | ||
env: | ||
CIBW_BUILD: cp312-manylinux_x86_64 | ||
with: | ||
config-file: cibuildwheel.toml | ||
package-dir: awkward-cpp | ||
|
||
- name: Upload wheels | ||
|
This file contains 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
This file was deleted.
Oops, something went wrong.