Skip to content

Commit f08eae3

Browse files
mhsmithhenryiii
authored andcommitted
Fix GHA configuration
1 parent 76af8d2 commit f08eae3

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/tests-cibw.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,23 @@ jobs:
6363
submodules: true
6464
fetch-depth: 0
6565

66+
# GitHub Actions can't currently run the Android emulator on macOS.
67+
- name: Skip Android tests on macOS
68+
if: contains(matrix.runs-on, 'macos')
69+
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
70+
71+
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
72+
- name: Enable KVM for Android emulator
73+
if: contains(matrix.runs-on, 'ubuntu')
74+
run: |
75+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
76+
sudo udevadm control --reload-rules
77+
sudo udevadm trigger --name-match=kvm
78+
6679
- run: pipx install wheel patchelf
6780

68-
- uses: mhsmith/cibuildwheel@android
81+
- uses: mhsmith/cibuildwheel@android # TODO: update to a released version
6982
env:
7083
CIBW_PLATFORM: android
71-
# Needed to include C++ in the wheel
72-
CIBW_ENVIRONMENT_ANDROID: ANDROID_API_LEVEL="24"
7384
with:
7485
package-dir: tests

tests/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# Warning: this is currently used for pyodide, and is not a general out-of-tree
2-
# builder for the tests (yet). Specifically, wheels can't be built from SDists.
1+
# Warning: this is currently used to test cross-compilation, and is not a general
2+
# out-of-tree builder for the tests (yet). Specifically, wheels can't be built from
3+
# SDists.
34

45
[build-system]
56
requires = ["scikit-build-core"]
@@ -29,6 +30,8 @@ test-sources = ["tests", "pyproject.toml"]
2930
test-command = "python -m pytest -o timeout=0 -p no:cacheprovider tests"
3031
environment.PIP_ONLY_BINARY = "numpy"
3132
environment.PIP_PREFER_BINARY = "1"
33+
34+
android.environment.ANDROID_API_LEVEL = "24" # Needed to include libc++ in the wheel.
3235
pyodide.test-groups = ["numpy", "scipy"]
3336
ios.test-groups = ["numpy"]
3437
ios.xbuild-tools = ["cmake", "ninja"]

0 commit comments

Comments
 (0)