Skip to content

Commit 68923cf

Browse files
authored
Optimize CI output for iOS/Android (aio-libs#12814)
1 parent d559f11 commit 68923cf

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,29 @@ jobs:
336336
- name: Cythonize
337337
run: |
338338
make cythonize
339+
- name: Enable KVM group perms for Android emulator
340+
if: ${{ matrix.config.platform == 'android' }}
341+
# This is normally done by cibuildwheel automatically, when it detects Github Actions. But by unsetting GITHUB_ACTIONS
342+
# in the test step, we also disable that automatic setup. So we need to do it manually here.
343+
run: |
344+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
345+
sudo udevadm control --reload-rules
346+
sudo udevadm trigger --name-match=kvm
347+
- name: Install cibuildwheel
348+
run: uv pip install cibuildwheel==3.4.1
339349
- name: Build wheels and test
340-
uses: pypa/cibuildwheel@v3.4.1
350+
# cibuildwheel normally uses grouping in its outputs for its build/test steps. But the loading time when
351+
# expanding large groups in GitHub Actions is very high. So by unsetting GITHUB_ACTIONS, cibuildwheel does
352+
# not know that it is running in a GitHub Action and thus does not use groups.
353+
run: env -u GITHUB_ACTIONS cibuildwheel
341354
env:
342355
CIBW_BUILD: ${{ matrix.pyver }}-*
343356
CIBW_PLATFORM: ${{ matrix.config.platform }}
344357
CIBW_ARCHS: ${{ matrix.config.archs }}
345358
CIBW_TEST_REQUIRES: -r requirements/test-mobile.txt
346359
CIBW_TEST_SOURCES: setup.cfg README.rst tests
347-
CIBW_TEST_COMMAND: python -m pytest
360+
# Currently only Android supports colored output. See https://github.com/python/cpython/issues/150932 for iOS.
361+
CIBW_TEST_COMMAND: python -m pytest ${{ matrix.config.platform == 'android' && '--color=yes' || '' }}
348362

349363
autobahn:
350364
permissions:

0 commit comments

Comments
 (0)