From e722a42cd820f767ff706034121c009ea5a3c135 Mon Sep 17 00:00:00 2001 From: Antelox Date: Wed, 23 Oct 2024 11:21:54 +0200 Subject: [PATCH] GitHub Action: Install Python2.7 and run tests for re-tagged wheels on native arch runners only --- .github/workflows/build-wheels-publish.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build-wheels-publish.yml b/.github/workflows/build-wheels-publish.yml index 4327b86901..a8afe509f1 100644 --- a/.github/workflows/build-wheels-publish.yml +++ b/.github/workflows/build-wheels-publish.yml @@ -161,6 +161,7 @@ jobs: python -m pip install -U pip wheel && Get-ChildItem -Path wheelhouse/ -Filter *cp38*.whl | Foreach-Object { python -m wheel tags --python-tag='py2' --abi-tag=none $_.FullName } + - name: '🚧 Python 2.7 wheels re-tagging - Non-Windows' if: matrix.os != 'windows-2019' env: @@ -168,6 +169,25 @@ jobs: run: | python3 -m pip install -U pip wheel && python3 -m wheel tags --python-tag='py2' --abi-tag=none wheelhouse/*cp38*.whl + - uses: LizardByte/setup-python-action@master + if: (matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64' && matrix.cibw_build == 'cp38-manylinux') || matrix.os == 'macos-latest' || (matrix.os == 'windows-2019' && matrix.arch == 'AMD64') + with: + python-version: 2.7 + + - name: 'Python 2.7 tests - Windows' + if: matrix.os == 'windows-2019' && matrix.arch == 'AMD64' + run: | + C:\Python27\python.exe -m pip install -U pip pytest && Get-ChildItem -Path wheelhouse/ -Filter *py2*.whl | Foreach-Object { + C:\Python27\python.exe -m pip install $_.FullName + C:\Python27\python.exe -m pytest bindings/python/tests + } + + # we install and test python2.7 wheels only on native arch + # NOTE: no python2.7 support for macos-13: https://github.com/LizardByte/setup-python-action/issues/2 + - name: 'Python 2.7 tests - Non-Windows' + if: (matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64' && matrix.cibw_build == 'cp38-manylinux') || matrix.os == 'macos-latest' + run: python2 -m pip install wheelhouse/*py2*.whl && python2 -m pip install -U pip pytest && python2 -m pytest bindings/python/tests + - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}-py38