mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-25 09:19:14 +00:00
ci: add android test (#5714)
* ci: add android test Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Fix Android tests (#23) * Android tests working * Clarifications * ci: only use fork on Android Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * ci: add wheel (missing) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * ci: no patchelf? Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * ci: forgot pyproject android mention Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Fix GHA configuration * Update to cibuildwheel 3.1 * Restore installation of "wheel" * Revert iOS to cibuildwheel 3.0 * Actually revert iOS back to cibuildwheel 3.0 * Restore iOS to cibuildwheel 3.1, and skip Python 3.14 instead * Update .github/workflows/tests-cibw.yml --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Malcolm Smith <smith@chaquo.com>
This commit is contained in:
47
.github/workflows/tests-cibw.yml
vendored
47
.github/workflows/tests-cibw.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: pypa/cibuildwheel@v3.0
|
- uses: pypa/cibuildwheel@v3.1
|
||||||
env:
|
env:
|
||||||
PYODIDE_BUILD_EXPORTS: whole_archive
|
PYODIDE_BUILD_EXPORTS: whole_archive
|
||||||
with:
|
with:
|
||||||
@@ -30,8 +30,12 @@ jobs:
|
|||||||
only: cp312-pyodide_wasm32
|
only: cp312-pyodide_wasm32
|
||||||
|
|
||||||
build-ios:
|
build-ios:
|
||||||
name: iOS wheel
|
name: iOS wheel ${{ matrix.runs-on }}
|
||||||
runs-on: macos-latest
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
runs-on: [macos-latest, macos-13]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -40,8 +44,43 @@ jobs:
|
|||||||
|
|
||||||
- run: brew upgrade cmake
|
- run: brew upgrade cmake
|
||||||
|
|
||||||
- uses: pypa/cibuildwheel@v3.0
|
- uses: pypa/cibuildwheel@v3.1
|
||||||
env:
|
env:
|
||||||
CIBW_PLATFORM: ios
|
CIBW_PLATFORM: ios
|
||||||
|
CIBW_SKIP: cp314-* # https://github.com/pypa/cibuildwheel/issues/2494
|
||||||
|
with:
|
||||||
|
package-dir: tests
|
||||||
|
|
||||||
|
build-android:
|
||||||
|
name: Android wheel ${{ matrix.runs-on }}
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
runs-on: [macos-latest, macos-13, ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# GitHub Actions can't currently run the Android emulator on macOS.
|
||||||
|
- name: Skip Android tests on macOS
|
||||||
|
if: contains(matrix.runs-on, 'macos')
|
||||||
|
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
|
||||||
|
- name: Enable KVM for Android emulator
|
||||||
|
if: contains(matrix.runs-on, 'ubuntu')
|
||||||
|
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: pipx install patchelf
|
||||||
|
|
||||||
|
- uses: pypa/cibuildwheel@v3.1
|
||||||
|
env:
|
||||||
|
CIBW_PLATFORM: android
|
||||||
with:
|
with:
|
||||||
package-dir: tests
|
package-dir: tests
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import sysconfig
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
ANDROID = sys.platform.startswith("android")
|
||||||
LINUX = sys.platform.startswith("linux")
|
LINUX = sys.platform.startswith("linux")
|
||||||
MACOS = sys.platform.startswith("darwin")
|
MACOS = sys.platform.startswith("darwin")
|
||||||
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
|
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Warning: this is currently used for pyodide, and is not a general out-of-tree
|
# Warning: this is currently used to test cross-compilation, and is not a general
|
||||||
# builder for the tests (yet). Specifically, wheels can't be built from SDists.
|
# out-of-tree builder for the tests (yet). Specifically, wheels can't be built from
|
||||||
|
# SDists.
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["scikit-build-core"]
|
requires = ["scikit-build-core"]
|
||||||
@@ -29,6 +30,8 @@ test-sources = ["tests", "pyproject.toml"]
|
|||||||
test-command = "python -m pytest -o timeout=0 -p no:cacheprovider tests"
|
test-command = "python -m pytest -o timeout=0 -p no:cacheprovider tests"
|
||||||
environment.PIP_ONLY_BINARY = "numpy"
|
environment.PIP_ONLY_BINARY = "numpy"
|
||||||
environment.PIP_PREFER_BINARY = "1"
|
environment.PIP_PREFER_BINARY = "1"
|
||||||
|
|
||||||
|
android.environment.ANDROID_API_LEVEL = "24" # Needed to include libc++ in the wheel.
|
||||||
pyodide.test-groups = ["numpy", "scipy"]
|
pyodide.test-groups = ["numpy", "scipy"]
|
||||||
ios.test-groups = ["numpy"]
|
ios.test-groups = ["numpy"]
|
||||||
ios.xbuild-tools = ["cmake", "ninja"]
|
ios.xbuild-tools = ["cmake", "ninja"]
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ def test_cross_module_exceptions(msg):
|
|||||||
|
|
||||||
# TODO: FIXME
|
# TODO: FIXME
|
||||||
@pytest.mark.xfail(
|
@pytest.mark.xfail(
|
||||||
"env.MACOS and env.PYPY",
|
"(env.MACOS and env.PYPY) or env.ANDROID",
|
||||||
raises=RuntimeError,
|
raises=RuntimeError,
|
||||||
reason="See Issue #2847, PR #2999, PR #4324",
|
reason="See Issue #2847, PR #2999, PR #4324",
|
||||||
strict=not env.PYPY, # PR 5569
|
strict=not env.PYPY, # PR 5569
|
||||||
|
|||||||
Reference in New Issue
Block a user