Skip to content

Commit

Permalink
ci: Test macOS arm64 wheels on self-hosted runners
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Dec 1, 2023
1 parent d34cb24 commit 8fc630a
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,10 @@ jobs:
- { wheel: cp312-macosx_x86_64, os: macos-latest }
- { wheel: cp312-manylinux_x86_64, os: ubuntu-latest }
- { wheel: cp312-win_amd64, os: windows-latest }

- { wheel: pp39-manylinux_x86_64, os: ubuntu-latest }

# Currently broken with PyPy 7.3? See https://foss.heptapod.net/pypy/pypy/-/issues/4013.
# - { wheel: pp39-macosx_x86_64, os: macos-latest }
# - { wheel: pp39-win_amd64, os: windows-latest }

steps:
- name: Download source distribution
uses: actions/download-artifact@v3
Expand All @@ -92,9 +89,42 @@ jobs:
CIBW_BUILD_VERBOSITY: 1
- uses: actions/upload-artifact@v3
with:
name: wheels
name: ${{ matrix.wheel }}
path: ./wheelhouse/*.whl

test_macos_arm64_wheels:
needs: build_wheels
name: Test ${{ matrix.wheel }} macOS ARM64 wheel
runs-on: [macOS, ARM64]
strategy:
matrix:
include:
- { wheel: cp310-macosx_arm64, python: '3.10' }
- { wheel: cp311-macosx_arm64, python: '3.11' }
- { wheel: cp312-macosx_arm64, python: '3.12' }
# Not supported by setup-python for the self-hosted runner:
# Error: The version '3.9' with architecture 'arm64' was not found for macOS 13.6.
# - { wheel: cp38-macosx_arm64, python: '3.8' }
# - { wheel: cp39-macosx_arm64, python: '3.9' }
steps:
- run: rm -rf dist
- uses: actions/download-artifact@v3
with:
name: source
path: dist
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.wheel }}
path: dist
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run: |
pip install --force-reinstall ./dist/*.whl
tar xvf ./dist/pypcode-*.tar.gz
cd pypcode-*/tests
python -m unittest discover -v -s .
build_docs:
name: Build docs
runs-on: ubuntu-latest
Expand All @@ -109,19 +139,17 @@ jobs:
upload_pypi:
name: Upload wheels to PyPI
needs: [lint, build_docs, build_sdist, build_wheels]
needs: [lint, build_docs, build_sdist, build_wheels, test_macos_arm64_wheels]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# Upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: source
path: dist
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
path: artifacts
- run: |
mkdir dist
find artifacts -type f -exec mv {} dist \;
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down

0 comments on commit 8fc630a

Please sign in to comment.