Skip to content

Use different runner for intel macOS. #31

Use different runner for intel macOS.

Use different runner for intel macOS. #31

Workflow file for this run

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: Building Wheels
on:
push:
# BEGIN: Temporary
branches:
- dhermes/python-3.12-wheels
# END: Temporary
tags:
- "*"
schedule:
# Scheduled workflows run on the latest commit on the default or base branch
- cron: "0 0 1 * *"
workflow_dispatch:
inputs:
reason:
description: Reason for manually triggering workflow
required: true
jobs:
linux:
if: ${{ false }} # BEGIN: Temporary
runs-on: ubuntu-22.04
strategy:
matrix:
include:
# NOTE: The ARM build(s) take considerably longer on GitHub Actions.
- artifact-name: linux-arm-3.10
cibw-archs: aarch64
cibw-build: cp310-*
- artifact-name: linux-arm-3.11
cibw-archs: aarch64
cibw-build: cp311-*
- artifact-name: linux-arm-3.12
cibw-archs: aarch64
cibw-build: cp312-*
- artifact-name: linux-intel
cibw-archs: x86_64
cibw-build: >-
cp310-*
cp311-*
cp312-*
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
if: matrix.cibw-archs == 'aarch64'
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
CIBW_ARCHS: ${{ matrix.cibw-archs }}
CIBW_BEFORE_BUILD: |
python -m pip install cmake nox numpy
nox --session libbezier-release
CIBW_BUILD: ${{ matrix.cibw-build }}
CIBW_ENVIRONMENT: >-
BEZIER_INSTALL_PREFIX=/project/.nox/.cache/libbezier-release/usr
LD_LIBRARY_PATH=/project/.nox/.cache/libbezier-release/usr/lib
TARGET_NATIVE_ARCH=OFF
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: pytest
CIBW_SKIP: "*musllinux*"
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ matrix.artifact-name }}
path: ./wheelhouse/*.whl
macos-intel:
runs-on: macos-14-large
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Install `gcc`
run: |
brew install gcc
brew unlink gcc
brew link gcc
- name: Build `libbezier`
env:
TARGET_NATIVE_ARCH: "OFF"
run: |
python3.12 -m pip install cmake nox
nox --session libbezier-release
- name: Inspect built dylib (temporary)
run: |
echo '$ /usr/bin/which gfortran'
/usr/bin/which gfortran
echo '$ ls -alFG $(dirname $(readlink -f $(/usr/bin/which gfortran)))'
ls -alFG $(dirname $(readlink -f $(/usr/bin/which gfortran)))
echo '$ file .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib'
file .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib
echo '$ otool -L .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib'
otool -L .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib
echo '$ lipo -archs .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib'
lipo -archs .nox/.cache/libbezier-release/usr/lib/libbezier.2023.7.28.dylib
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
BEZIER_INSTALL_PREFIX: ./.nox/.cache/libbezier-release/usr
CIBW_ARCHS: x86_64 # "x86_64 arm64"
CIBW_BEFORE_BUILD: |
python -m pip install numpy
CIBW_BUILD: >-
cp310-*
cp311-*
cp312-*
CIBW_ENVIRONMENT: >-
MACOSX_DEPLOYMENT_TARGET=14.0
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: pytest
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: macos-intel
path: ./wheelhouse/*.whl
sdist:
if: ${{ false }} # BEGIN: Temporary
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Install build dependencies
run: |
python3.12 -m pip install build
- name: Generate sdist (source distribution)
env:
BEZIER_NO_EXTENSION: "True"
run: |
python3.12 -m build --sdist .
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: sdist
path: ./dist/*.tar.gz
windows-intel:
if: ${{ false }} # BEGIN: Temporary
runs-on: windows-2022
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Build `libbezier`
env:
TARGET_NATIVE_ARCH: "OFF"
run: |
py -3.12 -m pip install cmake nox
nox --session libbezier-release
# MinGW is installed (by default) via Chocolatey:
# - https://github.com/actions/runner-images/blob/win22%2F20230724.1/images/win/toolsets/toolset-2022.json#L165
# - https://community.chocolatey.org/packages/mingw/11.2.0.07112021
# - https://github.com/actions/runner-images/issues/6103
- name: Add MinGW bin dir to PATH
shell: powershell
run: |
"C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
BEZIER_INSTALL_PREFIX: .\.nox\.cache\libbezier-release\usr
CIBW_ARCHS: AMD64
CIBW_BEFORE_BUILD: |
python -m pip install delvewheel numpy
CIBW_BUILD: >-
cp310-*
cp311-*
cp312-*
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair
--wheel-dir {dest_dir}
--add-path .\.nox\.cache\libbezier-release\usr\bin
{wheel}
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: pytest
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: windows-intel
path: .\wheelhouse\*.whl