Skip to content

Commit

Permalink
Upgrade GitHub actions
Browse files Browse the repository at this point in the history
Focus on supported Python versions from 3.6 to 3.12. Bump all action
versions to the latest. Take some inspiration from ska-sa/spead2#317
to try out macos-14 (Mx) builds for the first time.
  • Loading branch information
ludwigschwardt committed Apr 19, 2024
1 parent ff81c30 commit 4c66b6f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ jobs:
name: Test on Python ${{ matrix.python }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04, macos-14]
python: [cp36, cp37, cp38, cp39, cp310, cp311, cp312]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
66 changes: 44 additions & 22 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,61 @@ jobs:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- run: pip install build
- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
run: python -m build --sdist .
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
build_wheel_linux:
name: Build wheels on Linux
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
arch: [x86_64, aarch64]
python: [cp36, cp37, cp38, cp39, cp310, cp311, cp312]
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
platforms: arm64
if: matrix.arch != 'x86_64'
- uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_ARCHS_LINUX: auto64 aarch64
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.python }}-manylinux*
- uses: actions/upload-artifact@v4
with:
name: wheel_linux-${{ matrix.arch }}-${{ matrix.python }}
path: wheelhouse/*.whl

- name: Upload wheels
uses: actions/upload-artifact@v3
build_wheel_macos:
name: Build wheels on macOS
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
python: [cp36, cp37, cp38, cp39, cp310, cp311, cp312]
exclude:
# Python < 3.9 not natively available for Apple Silicon.
# cibuildwheel tries to do a cross build, which fails.
- os: macos-14
python: cp36
- os: macos-14
python: cp37
- os: macos-14
python: cp38
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_BUILD: ${{ matrix.python }}-macos*
- uses: actions/upload-artifact@v4
with:
name: wheels
name: wheel_macos-${{ matrix.os }}-${{ matrix.python }}
path: wheelhouse/*.whl

0 comments on commit 4c66b6f

Please sign in to comment.