Skip to content

Commit

Permalink
Add macOS arm64 support and use latest runners for cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier2k6 committed Feb 10, 2024
1 parent 3770d17 commit 56ce71c
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build_and_store_wheels: &BUILD_AND_STORE_WHEELS
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
install_cibuildwheel_script:
- $PYTHON -m pip install cibuildwheel==2.16.3
- $PYTHON -m pip install cibuildwheel==2.16.5

run_cibuildwheel_script:
- cibuildwheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down
73 changes: 51 additions & 22 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,51 @@ jobs:
# github actions syntax doesn't allow us to have yaml structures as
# an input to a job. These environment variables are literal json strings
MATRIX_PULL_REQUEST: |
{
"include": [
{"os": "ubuntu-latest", "CIBW_BUILD": "cp37-manylinux_*", "CIBW_ARCHS": "x86_64"},
{"os": "ubuntu-latest", "CIBW_BUILD": "cp37-musllinux_*", "CIBW_ARCHS": "x86_64"},
{"os": "macos-12", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "x86_64"},
{"os": "windows-2022", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "AMD64"}
]
}
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python: ["39", "310", "311", "312"]
platform_id:
- win_amd64
- win32
- manylinux_x86_64
- manylinux_aarch64
- musllinux_x86_64
- musllinux_aarch64
- macosx_x86_64
exclude:
# Skip certain Python, Linux and Mac builds on Windows
- os: windows-latest
python: "310", "311", "312"
platform_id: manylinux_aarch64
platform_id: manylinux_x86_64
platform_id: macosx_x86_64
platform_id: musllinux_x86_64
platform_id: musllinux_aarch64
# Skip certain Python, Mac and Windows builds on Linux
- os: ubuntu-latest
python: "310", "311", "312"
platform_id: macosx_x86_64
platform_id: win_amd64
platform_id: win32
# Skip certain Python, Linux and Windows builds on Mac
- os: macos-latest
python: "310", "311", "312"
platform_id: win_amd64
platform_id: win32
platform_id: manylinux_x86_64
platform_id: manylinux_aarch64
platform_id: musllinux_x86_64
platform_id: musllinux_aarch64
MATRIX_WORKFLOW_DISPATCH: |
{
"include": [
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "x86_64"},
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_*", "CIBW_ARCHS": "aarch64"},
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "x86_64"},
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_*", "CIBW_ARCHS": "aarch64"},
{"os": "macos-12", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86_64"},
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86"},
{"os": "windows-2022", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "AMD64"}
{"os": "macos-latest", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86_64"},
{"os": "macos-latest", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "arm64"},
{"os": "windows-latest", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "x86"},
{"os": "windows-latest", "CIBW_BUILD": "cp*", "CIBW_ARCHS": "AMD64"}
]
}
Expand All @@ -86,25 +113,27 @@ jobs:

env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: ${{ matrix.CIBW_BUILD }}
CIBW_ARCHS: ${{ matrix.CIBW_ARCHS }}
CIBW_ARCHS_LINUX: "x86_64, aarch64"
CIBW_ARCHS_MACOS: "x86_64, arm64"
CIBW_ARCHS_WINDOWS: "auto"
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_TEST_SKIP: "*-win32"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-wheel
with:
path: wheelhouse
key: wheel-${{ matrix.CIBW_BUILD }}-${{ matrix.CIBW_ARCHS }}-${{ github.sha }}
key: wheel-${{ matrix.os }}-${{ matrix.platform_id }}-${{ github.sha }}

- uses: docker/setup-qemu-action@v2
- uses: docker/setup-qemu-action@v3
if: steps.cache-wheel.outputs.cache-hit != 'true' && runner.os == 'Linux'

- uses: pypa/cibuildwheel@v2.12.3
- uses: pypa/cibuildwheel@v2.16.5
if: steps.cache-wheel.outputs.cache-hit != 'true'

- uses: actions/upload-artifact@v3
Expand All @@ -126,8 +155,8 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: wheelhouse
skip_existing: true
packages-dir: wheelhouse
skip-existing: true

upload_pypi_test:
needs: build_wheels
Expand All @@ -143,6 +172,6 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: wheelhouse
skip_existing: true
packages-dir: wheelhouse
skip-existing: true
repository_url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -36,27 +36,27 @@ jobs:
- name: After Prepare (cpp)
if: ${{ matrix.language == 'cpp' }}
run: 'wget -q "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-linux-x86_64.tar.gz"
run: 'wget -q "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz"
tar xzf cmake-3.21.2-linux-x86_64.tar.gz
tar xzf cmake-3.28.3-linux-x86_64.tar.gz
'

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Build cpp
if: ${{ matrix.language == 'cpp' }}
run: './cmake-3.21.2-linux-x86_64/bin/cmake -Dbuild_examples=ON -Dbuild_tests=ON -Dbuild_tools=ON -GNinja .
run: './cmake-3.28.3-linux-x86_64/bin/cmake -Dbuild_examples=ON -Dbuild_tests=ON -Dbuild_tools=ON -GNinja .
./cmake-3.21.2-linux-x86_64/bin/cmake --build .
./cmake-3.28.3-linux-x86_64/bin/cmake --build .
'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: update package lists
continue-on-error: true
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
# TODO: matrix across python version and os
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1

build:
name: build
Expand All @@ -34,7 +34,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests
- name: run tests (flaky)
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
retry_wait_seconds: 4
Expand All @@ -263,7 +263,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -331,9 +331,9 @@ jobs:
- name: build tarball
run: AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html make dist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: tarball
name: tarball-${{ matrix.os }}
path: libtorrent-rasterbar-*.tar.gz

- name: test-tarball (b2 install)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -41,7 +41,7 @@ jobs:
run: (cd test; b2 ${{ matrix.config }} -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests)

- name: run tests (flaky)
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
retry_wait_seconds: 1
Expand All @@ -55,7 +55,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -114,7 +114,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
os: [ubuntu-20.04, macos-latest, windows-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: install openssl (windows)
if: runner.os == 'Windows'
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
shell: cmd
timeout_minutes: 5
Expand Down
Loading

0 comments on commit 56ce71c

Please sign in to comment.