Skip to content

Create python-cibuildwheel.yml #42

Create python-cibuildwheel.yml

Create python-cibuildwheel.yml #42

name: Python cibuildwheel
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
arch: [ 'x86_64' ]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.arch }}-python
- name: Build wheels on x86_64
if: matrix.arch == 'x86_64'
uses: pypa/[email protected]
env:
CIBW_BUILD: 'cp311-*'
CIBW_ARCHS_LINUX: auto64
CIBW_ARCHS_MACOS: x86_64
CIBW_SKIP: "*-musllinux_*"
# (many)linux build environment
CIBW_MANYLINUX_X86_64_IMAGE: 'keyvidev/manylinux-builder-x86_64'
CIBW_MANYLINUX_AARCH64_IMAGE: 'keyvidev/manylinux-builder-aarch64'
# macos build environment
CIBW_BEFORE_ALL_MACOS: >
brew update &&
brew install zlib snappy boost &&
brew install ccache
# ccache
CIBW_ENVIRONMENT: PATH=/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH
CIBW_ENVIRONMENT_LINUX: CCACHE_DIR=/host/$GITHUB_WORKSPACE/.ccache
CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_WORKSPACE
# python dependencies
CIBW_BEFORE_BUILD: pip install -r python/requirements.txt
# testing
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >
python -m pytest {package}/tests &&
python -m pytest {package}/integration-tests
with:
package-dir: python
- name: Build wheels on arm64
if: matrix.arch == 'arm64'
uses: pypa/[email protected]
env:
CIBW_BUILD: 'cp311-*'
CIBW_ARCHS_LINUX: aarch64
CIBW_ARCHS_MACOS: arm64
CIBW_SKIP: "*-musllinux_*"
# (many)linux build environment
CIBW_MANYLINUX_X86_64_IMAGE: 'keyvidev/manylinux-builder-x86_64'
CIBW_MANYLINUX_AARCH64_IMAGE: 'keyvidev/manylinux-builder-aarch64'
# macos build environment
CIBW_BEFORE_ALL_MACOS: >
brew update &&
brew install zlib snappy boost &&
brew install ccache
# ccache
CIBW_ENVIRONMENT: PATH=/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH
CIBW_ENVIRONMENT_LINUX: CCACHE_DIR=/host/$GITHUB_WORKSPACE/.ccache
CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_WORKSPACE
# python dependencies
CIBW_BEFORE_BUILD: pip install -r python/requirements.txt
# testing
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >
python -m pytest {package}/tests &&
python -m pytest {package}/integration-tests
with:
package-dir: python
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl