| 1 |
name: Test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
pull_request: |
| 8 |
workflow_dispatch: |
| 9 |
# allow manual runs on branches without a PR |
| 10 |
|
| 11 |
concurrency: |
| 12 |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} |
| 13 |
cancel-in-progress: true |
| 14 |
|
| 15 |
permissions: {} |
| 16 |
|
| 17 |
jobs: |
| 18 |
pre-commit: |
| 19 |
name: Pre-commit checks (Black, Flake8, MyPy, ...) |
| 20 |
runs-on: ubuntu-latest |
| 21 |
permissions: |
| 22 |
contents: read |
| 23 |
steps: |
| 24 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 25 |
with: |
| 26 |
persist-credentials: false |
| 27 |
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 28 |
with: |
| 29 |
python-version: "3.10" |
| 30 |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 |
| 31 |
|
| 32 |
test-dist: |
| 33 |
name: Test SDist & wheel |
| 34 |
needs: pre-commit |
| 35 |
runs-on: ubuntu-latest |
| 36 |
permissions: |
| 37 |
contents: read |
| 38 |
steps: |
| 39 |
- name: Checkout |
| 40 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 41 |
with: |
| 42 |
persist-credentials: false |
| 43 |
- name: Install CPython 3.10 |
| 44 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 45 |
with: |
| 46 |
python-version: "3.10" |
| 47 |
architecture: x64 |
| 48 |
- name: Run tests |
| 49 |
run: pipx run nox -s test-sdist-3.10 test-wheel-3.10 |
| 50 |
|
| 51 |
test: |
| 52 |
name: CPython ${{ matrix.python }} ${{ matrix.platform[0] }} on ${{ matrix.platform[1] }} |
| 53 |
needs: test-dist |
| 54 |
runs-on: ${{ matrix.platform[1] }} |
| 55 |
permissions: |
| 56 |
contents: read |
| 57 |
strategy: |
| 58 |
fail-fast: false |
| 59 |
matrix: |
| 60 |
platform: |
| 61 |
- [ 'x86_64', 'ubuntu-24.04' ] |
| 62 |
python: [ '3.10', '3.11', '3.12', '3.13', '3.14' ] |
| 63 |
include: |
| 64 |
- platform: [ 'aarch64', 'ubuntu-24.04-arm' ] |
| 65 |
python: '3.12' |
| 66 |
- platform: [ 'i686', 'ubuntu-24.04' ] |
| 67 |
python: '3.12' |
| 68 |
- platform: [ 'armv7l', 'ubuntu-24.04-arm' ] |
| 69 |
python: '3.12' |
| 70 |
- platform: [ 'ppc64le', 'ubuntu-24.04' ] |
| 71 |
python: '3.12' |
| 72 |
qemu: true |
| 73 |
- platform: [ 's390x', 'ubuntu-24.04' ] |
| 74 |
python: '3.12' |
| 75 |
qemu: true |
| 76 |
- platform: [ 'riscv64', 'ubuntu-24.04' ] |
| 77 |
python: '3.12' |
| 78 |
qemu: true |
| 79 |
- platform: [ 'aarch64', 'macos-26' ] |
| 80 |
python: '3.12' |
| 81 |
steps: |
| 82 |
- name: Checkout |
| 83 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 84 |
with: |
| 85 |
persist-credentials: false |
| 86 |
- name: Setup cache |
| 87 |
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 88 |
with: |
| 89 |
path: ~/.cache/auditwheel_tests |
| 90 |
key: python${{ matrix.python }}-${{ matrix.platform[0] }}-${{ hashFiles('**/test_manylinux.py') }} |
| 91 |
restore-keys: python${{ matrix.python }}-${{ matrix.platform[0] }}- |
| 92 |
- name: Install CPython ${{ matrix.python }} |
| 93 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 94 |
with: |
| 95 |
python-version: "${{ matrix.python }}" |
| 96 |
allow-prereleases: true |
| 97 |
- name: Set up QEMU |
| 98 |
if: matrix.qemu |
| 99 |
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 |
| 100 |
- name: Run tests |
| 101 |
run: pipx run nox -s tests-${{ matrix.python }} |
| 102 |
env: |
| 103 |
AUDITWHEEL_ARCH: ${{ matrix.platform[0] }} |
| 104 |
AUDITWHEEL_QEMU: ${{ matrix.qemu }} |
| 105 |
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 106 |
with: |
| 107 |
name: coverage-${{ matrix.python }}-${{ matrix.platform[0] }}-${{ matrix.platform[1] }} |
| 108 |
path: coverage-*.xml |
| 109 |
retention-days: 1 |
| 110 |
|
| 111 |
coverage_report: |
| 112 |
name: Coverage Report |
| 113 |
needs: [test] |
| 114 |
runs-on: ubuntu-slim |
| 115 |
if: github.repository == 'pypa/auditwheel' |
| 116 |
permissions: |
| 117 |
contents: read |
| 118 |
id-token: write # upload to codecov with OIDC |
| 119 |
steps: |
| 120 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 121 |
with: |
| 122 |
submodules: recursive |
| 123 |
persist-credentials: false |
| 124 |
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 125 |
with: |
| 126 |
pattern: coverage-* |
| 127 |
merge-multiple: true |
| 128 |
- name: Upload coverage to codecov |
| 129 |
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 |
| 130 |
with: |
| 131 |
use_oidc: true |
| 132 |
|
| 133 |
check_all_green: |
| 134 |
if: always() |
| 135 |
name: Check all tests green |
| 136 |
needs: [pre-commit, test-dist, test, coverage_report] |
| 137 |
runs-on: ubuntu-slim |
| 138 |
steps: |
| 139 |
- name: Decide whether the needed jobs succeeded or failed |
| 140 |
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 |
| 141 |
with: |
| 142 |
jobs: ${{ toJSON(needs) }} |
| 143 |
allowed-skips: ${{ (github.repository != 'pypa/auditwheel') && 'coverage_report' || '' }} |