chore(ci): split emulation tests per architecture (#1839)

This commit is contained in:
Matthieu Darbois
2024-05-27 22:34:10 -04:00
committed by GitHub
parent b713086763
commit 2e6b11e10c
4 changed files with 50 additions and 16 deletions
+28 -7
View File
@@ -31,7 +31,7 @@ jobs:
run: pipx run nox -s pylint -- --output-format=github
test:
name: Test cibuildwheel on ${{ matrix.os }} (${{ matrix.python_version }})
name: Test on ${{ matrix.os }} (${{ matrix.python_version }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
@@ -125,19 +125,41 @@ jobs:
run: |
python ./bin/run_tests.py --run-podman
test-emulated:
name: Test emulated cibuildwheel using qemu
emulated-archs:
name: Get qemu emulated architectures
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 180
outputs:
archs: ${{ steps.archs.outputs.archs }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install ".[test]"
- name: Get qemu emulated architectures
id: archs
run: |
python -m pip install ".[test]"
OUTPUT=$(python -c "from json import dumps; from test.utils import EMULATED_ARCHS; print(dumps(EMULATED_ARCHS))")
echo "${OUTPUT}"
echo "archs=${OUTPUT}" >> "$GITHUB_OUTPUT"
test-emulated:
name: Test Linux ${{ matrix.arch }} using qemu
needs: emulated-archs
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
matrix:
arch: ${{ fromJSON(needs.emulated-archs.outputs.archs) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install ".[test]"
- name: Set up QEMU
id: qemu
@@ -146,5 +168,4 @@ jobs:
platforms: all
- name: Run the emulation tests
run: |
pytest --run-emulation test/test_emulation.py
run: pytest --run-emulation ${{ matrix.arch }} test/test_emulation.py