From 3d821f5b53d418e34141c8545c8a5f8aec0ed2ad Mon Sep 17 00:00:00 2001 From: Janakarajan Natarajan Date: Fri, 14 Oct 2022 18:29:28 +0000 Subject: [PATCH] Build aarch64 wheels Also, build and test x86 wheels in one step, similar to aarch64. --- .github/workflows/create.yml | 41 ++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create.yml b/.github/workflows/create.yml index 087ef456..dbeeee59 100644 --- a/.github/workflows/create.yml +++ b/.github/workflows/create.yml @@ -14,7 +14,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_MACOS: '' strategy: matrix: - os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] + os: ['windows-latest', 'macos-latest'] architecture: ['x64'] include: - os: windows-latest @@ -25,9 +25,18 @@ jobs: cibw_skip: '*-win32' - os: ubuntu-latest architecture: 'x64' - cibw_skip: '*-manylinux_i686' + cibw_archs: 'x86_64' + - os: ubuntu-latest + architecture: 'aarch64' + cibw_archs: aarch64 runs-on: ${{ matrix.os }} steps: + - name: Set up QEMU for aarch64 wheels + if: ${{ matrix.cibw_archs == 'aarch64' }} + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + - name: Checkout pyjnius uses: actions/checkout@v3 @@ -47,9 +56,21 @@ jobs: distribution: 'temurin' architecture: ${{ matrix.architecture }} - - name: Build wheels + - name: Build Windows and MacOS wheels + if: ${{ matrix.os != 'ubuntu-latest' }} + env: + CIBW_SKIP: '*musllinux* ${{ matrix.cibw_skip }}' + run: python -m cibuildwheel --output-dir dist + + - name: Build and test Linux wheels + if: ${{ matrix.os == 'ubuntu-latest' }} env: CIBW_SKIP: '*musllinux* ${{ matrix.cibw_skip }}' + CIBW_ARCHS: '${{ matrix.cibw_archs }}' + CIBW_TEST_REQUIRES: 'pytest' + CIBW_TEST_EXTRAS: 'dev,ci' + CIBW_BEFORE_TEST: 'yum install ant -y && cd {project} && ant all' + CIBW_TEST_COMMAND: 'cd {project}/tests/ && CLASSPATH=../build/test-classes:../build/classes python -m pytest -v' run: python -m cibuildwheel --output-dir dist - name: upload wheels @@ -88,7 +109,7 @@ jobs: continue-on-error: true strategy: matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + os: ['macos-latest', 'windows-latest'] python: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9'] include: # We may would like to introduce tests also on windows-latest on x86 (win32 wheels)? @@ -96,8 +117,6 @@ jobs: architecture: 'x64' - os: macos-latest architecture: 'x64' - - os: ubuntu-latest - architecture: 'x64' - os: apple-silicon-m1 architecture: 'aarch64' python: '3.8.13' @@ -145,11 +164,11 @@ jobs: arm64_set_path_and_python_version ${{ matrix.python }} ant all - - name: Build test-classes via ant (Linux, Windows) - if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'windows-latest') + - name: Build test-classes via ant (Windows) + if: matrix.os == 'windows-latest' run: ant all - - name: Install pyjnius wheel + test prerequisites (Windows, Linux, macOS x64) + - name: Install pyjnius wheel + test prerequisites (Windows, macOS x64) if: matrix.os != 'apple-silicon-m1' run: python -m pip install --find-links=dist pyjnius[dev,ci] @@ -160,8 +179,8 @@ jobs: arm64_set_path_and_python_version ${{ matrix.python }} python -m pip install --find-links=dist pyjnius[dev,ci] - - name: Test wheel (Linux, macOS x64) - if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') + - name: Test wheel (macOS x64) + if: matrix.os == 'macos-latest' run: | cd tests CLASSPATH=../build/test-classes:../build/classes python -m pytest -v