Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 39 additions & 23 deletions .github/workflows/cibw-cc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,62 @@ on:
workflow_dispatch:
pull_request:
branches:
- master
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
build-pyodide:
name: Pyodide
runs-on: ubuntu-latest
build:
strategy:
fail-fast: false
matrix:
include:
- platform: android
os: macos-13
- platform: android
os: macos-latest
- platform: ios
os: macos-latest
archs: all
- platform: pyodide
os: ubuntu-latest

name: ${{ matrix.platform }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5

- uses: pypa/[email protected]
env:
CIBW_PLATFORM: pyodide
- if: matrix.platform == 'ios'
run: brew upgrade cmake

- uses: actions/upload-artifact@v4
with:
name: wheels-pyodide
path: dist/*.whl
# GitHub Actions can't currently run the Android emulator on macOS.
- name: Skip Android tests on macOS
if: runner.os == 'macOS'
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"

build-ios:
name: iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
- name: Enable KVM for Android emulator
if: runner.os == 'Linux' && matrix.platform == 'android'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- run: brew upgrade cmake
- if: matrix.platform == 'android'
run: pipx install patchelf

- uses: pypa/cibuildwheel@v3.1
- uses: pypa/cibuildwheel@63bdd4f043a77f1bd23b2ba9376972b6dc7b4779
env:
CIBW_PLATFORM: ios
CIBW_ARCHS: all
CIBW_PLATFORM: ${{ matrix.platform }}
CIBW_ARCHS: ${{ matrix.archs || 'auto' }}

- uses: actions/upload-artifact@v4
with:
name: wheels-ios
name: wheels-${{ matrix.platform }}-${{ matrix.os }}
path: dist/*.whl
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ build-frontend = {name = "build", args = ["--exports", "whole_archive"]}
build-frontend = "build"
xbuild-tools = ["cmake", "ninja"]

[tool.cibuildwheel.android]
build-frontend = "build"
environment.ANDROID_API_LEVEL = "24"

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
Expand Down
Loading