From 174a6a8b9347dfa5d9085469422c4033985eeded Mon Sep 17 00:00:00 2001 From: Matthieu Dartiailh Date: Fri, 27 Aug 2021 09:24:43 +0200 Subject: [PATCH] CI: fix building wheels on GHA (#118) * ci: fix wheel build command * ci: remove references to submodules * ci: fix sdist command and remove Python 3.6 from the matrix * ci: slightly alter invocation * ci: disable emulation * ci: smaller matrix * ci: use a small matrix but with all python versions * ci: use manylinux 2010 for CPython 3.9+ * ci: split again matrix per python version given how slow emulation is Fix also the artifact upload * ci: fix typo * ci: typo --- .github/workflows/release.yml | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2202f715..1b79810b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Test sdist run: | pip install pytest - pip install --no-index --find-links dist atom + pip install --no-index --find-links dist kiwisolver cd .. python -m pytest kiwi/py/tests - name: Store artifacts @@ -43,49 +43,54 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: [cp36, cp37, cp38, cp39, cp310, pp37] + python: [cp37, cp38, cp39, cp310, pp3.7] steps: - name: Checkout uses: actions/checkout@v2 - - name: Update repo - run: | - git submodule update --init - cd kiwi - git checkout ${{ env.BUILD_COMMIT }} - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.8' - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install wheel cibuildwheel + python-version: '3.9' - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v1 with: platforms: all - name: Build wheels + uses: pypa/cibuildwheel@v2.1.1 + if: matrix.python == 'cp37' || matrix.python == 'cp38' env: CIBW_BUILD: ${{ matrix.python }}-* CIBW_ARCHS_MACOS: x86_64 universal2 arm64 # configure cibuildwheel to build native archs ('auto'), and some # emulated ones CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: python -m pytest {package}/py/tests -v - # Move to 2010 or 2014 when matplotlib does CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 CIBW_MANYLINUX_I686_IMAGE: manylinux1 + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: python -m pytest {package}/py/tests -v + # Do not link against VC2014_1 on Windows + KIWI_DISABLE_FH4: 1 + - name: Build wheels + uses: pypa/cibuildwheel@v2.1.1 + if: matrix.python != 'cp37' && matrix.python != 'cp38' + env: + CIBW_BUILD: "cp39-* cp310-* pp37-*" + CIBW_ARCHS_MACOS: x86_64 universal2 arm64 + # configure cibuildwheel to build native archs ('auto'), and some + # emulated ones + CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 + CIBW_MANYLINUX_I686_IMAGE: manylinux2010 + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: python -m pytest {package}/py/tests -v # Do not link against VC2014_1 on Windows KIWI_DISABLE_FH4: 1 - run: | - python -m cibuildwheel kiwi --output-dir dist - name: Store artifacts uses: actions/upload-artifact@v2 with: name: artifact - path: dist/*.whl + path: ./wheelhouse/*.whl release_upload: name: Create Release and Upload Release Asset