PYTHON-4177 Build and Test M1 macOS wheels on GHA (#1497)

This commit is contained in:
Steven Silvester 2024-02-01 12:55:31 -06:00 committed by GitHub
parent b185e50e41
commit 78ccdcb2b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 15 deletions

View File

@ -8,6 +8,7 @@ on:
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
pull_request:
concurrency:
group: wheels-${{ github.ref }}
@ -33,10 +34,22 @@ jobs:
- [ubuntu-20.04, manylinux_ppc64le]
- [ubuntu-20.04, manylinux_s390x]
- [ubuntu-20.04, manylinux_i686]
- [macos-11, macosx_*]
- [windows-2019, win_amd64]
- [windows-2019, win32]
python: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
include:
- buildplat: [macos-11, macosx_x86_64]
python: "cp37"
- buildplat: [macos-11, macosx_*]
python: "cp38"
- buildplat: [macos-11, macosx_*]
python: "cp39"
- buildplat: [macos-14, macosx_*]
python: "cp310"
- buildplat: [macos-14, macosx_*]
python: "cp311"
- buildplat: [macos-14, macosx_*]
python: "cp312"
steps:
- name: Checkout pymongo
@ -66,18 +79,15 @@ jobs:
# Note: the default manylinux is manylinux2014
run: python -m pip install "cibuildwheel>=2.4,<3"
- name: Build MacOS Py37 Wheel
# Universal wheels are not supported with Python 3.7, so we explicitly
# produce an x86_64 wheel for Python 3.7 on MacOS.
if: ${{ matrix.python == 'cp37' && matrix.buildplat[0] == 'macos-11' }}
- name: Build wheel
if: ${{ matrix.buildplat[0] != 'macos-14' }}
env:
CIBW_BUILD: cp37-macosx_x86_64
CIBW_ARCHS: x86_64
CIBW_TEST_COMMAND: "python {project}/tools/fail_if_no_c.py"
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
MACOS_TEST_SKIP: "*arm64"
run: python -m cibuildwheel --output-dir wheelhouse
- name: Build wheel
if: ${{ matrix.python != 'cp37' || matrix.buildplat[0] != 'macos-11' }}
- name: Build wheel on M1
if: ${{ matrix.buildplat[0] == 'macos-14' }}
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
run: python -m cibuildwheel --output-dir wheelhouse

View File

@ -235,8 +235,3 @@ test-command = "python {project}/tools/fail_if_no_c.py"
[tool.cibuildwheel.linux]
archs = "x86_64 aarch64 ppc64le s390x i686"
[tool.cibuildwheel.macos]
archs = "universal2"
test-command = "ENSURE_UNIVERSAL2=1 python {project}/tools/fail_if_no_c.py"
test-skip = "*-macosx_universal2:arm64"