Skip to content

Update to latest cibuildwheel #834

Update to latest cibuildwheel

Update to latest cibuildwheel #834

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
tags:
- "*"
pull_request:
schedule:
- cron: '30 2 * * 1,4' # Every Monday and Thursday @ 2h30am UTC
env:
HOST_PYTHON_VERSION: "3.10"
VCPKG_INSTALLED_DIR: /tmp/vcpkg_installed
ARTIFACT_NAME: wheel
jobs:
build-sdist:
name: Build Source Distribution
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Set up Python ${{ env.HOST_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.HOST_PYTHON_VERSION }}
- name: Upgrade pip and install build
run: python -m pip install -U pip build
- name: Checkout source
uses: actions/checkout@v4
- name: Build source distribution
run: python -m build --sdist
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-source
path: ./dist/*.tar.gz
cpp-tests:
name: Execute C++ test cases
runs-on: ubuntu-latest
env:
VCPKG_TARGET_TRIPLET: "x64-linux-dynamic-cxx17-abi1-rel"
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python ${{ env.HOST_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.HOST_PYTHON_VERSION }}
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: List directory structure
run: tree
- name: Install C++ Compiler and cmake
run: |
sudo apt update
sudo apt install build-essential cmake
python -m pip install -U pip
python -m pip install pyarrow
- name: Build C++ libraries and tests
env:
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
VCPKG_TARGET_TRIPLET: ${{ env.VCPKG_TARGET_TRIPLET }}
run: |
cmake -S . -B build
cmake --build build
- name: Execute C++ tests
run: |
cd build
ctest --verbose
# - name: Debug with tmate on failure
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
build-wheels:
name: Build wheel for ${{ matrix.cpython }}-${{ matrix.os_short }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-13", "macos-14"]
# https://peps.python.org/pep-0425
cpython: ["cp310", "cp311", "cp312"]
is_main_or_release:
- ${{ contains(github.ref, 'main') || startsWith(github.ref, 'refs/tags')}}
# Avoid building all wheels in a PR
exclude:
- is_main_or_release: false
cpython: cp310
- is_main_or_release: false
cpython: cp312
include:
- os: ubuntu-22.04
os_short: linux
arch: "x86_64"
triplet: "x64-linux-dynamic-cxx17-abi1-rel"
extra_build: "manylinux_x86_64"
- os: macos-13
os_short: macos
arch: "x86_64"
triplet: "x64-osx-dynamic-cxx17-abi1-rel"
extra_build: "macosx_x86_64"
- os: macos-14
os_short: macos
arch: "arm64"
triplet: "arm64-osx-dynamic-cxx17-abi1-rel"
extra_build: "macosx_arm64"
steps:
- name: Set up Python ${{ env.HOST_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.HOST_PYTHON_VERSION }}
- name: Upgrade pip and install virtualenv
run: python -m pip install -U pip virtualenv
- name: Checkout source
uses: actions/checkout@v4
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Set Common Build Environment Variable
env:
COMMON_ENV: >
CMAKE_ARGS=-DBUILD_TESTING=OFF
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
VCPKG_BINARY_SOURCES="clear;x-gha,readwrite"
VCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
VCPKG_INSTALLED_DIR=${{ env.VCPKG_INSTALLED_DIR }}
LD_LIBRARY_PATH=${{ env.VCPKG_INSTALLED_DIR }}/${{ matrix.triplet }}/lib
run: echo "CIBW_ENVIRONMENT_COMMON=$COMMON_ENV" >> $GITHUB_ENV
- name: Run cibuildwheel
env:
CIBW_BUILD: ${{ matrix.cpython }}-${{ matrix.extra_build }}
CIBW_BUILD_FRONTEND: build
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_ALL_LINUX: yum install -y zip flex bison gcc-gfortran
CIBW_BEFORE_ALL_MACOS: brew uninstall --zap gcc
CIBW_ENVIRONMENT: ${{ env.CIBW_ENVIRONMENT_COMMON }}
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_TEST_EXTRAS_LINUX: applications,test
CIBW_TEST_COMMAND_LINUX: py.test -s -vvv --pyargs arcae
CIBW_TEST_COMMAND_MACOS: python -c "from arcae.testing import sanity; sanity()"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair
-w {dest_dir} {wheel}
--exclude libarrow_python.so
--exclude libarrow.so.1601
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH delocate-listdeps {wheel}
DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH delocate-wheel \
--require-archs {delocate_archs} \
-w {dest_dir} \
-v {wheel} \
--exclude libarrow_python.dylib \
--exclude libarrow.1601.dylib \
--ignore-missing-dependencies
run: bash ci/scripts/run_cibuildwheel.sh
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}-${{ matrix.os_short }}-${{ matrix.cpython }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
- name: Debug with tmate on failure
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
upload-to-test-pypi:
name: Upload release to Test PyPI
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
environment:
name: release-test
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ env.ARTIFACT_NAME }}-*
merge-multiple: true
path: dist
- name: List artifacts
run: ls -lh dist
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
continue-on-error: true
upload-to-pypi:
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ env.ARTIFACT_NAME }}-*
merge-multiple: true
path: dist
- name: List artifacts
run: ls -lh dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1