ci: skip long-running wheels build except when publishing #85
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build wheels | |
on: | |
pull_request: | |
workflow_call: | |
inputs: | |
skip: | |
description: skip known long-running builds build (>10 minutes) | |
required: false | |
type: boolean | |
default: true | |
jobs: | |
build_wheels: | |
name: Build wheels for ${{ matrix.python-version }}-${{ matrix.buildplat[1] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
matrix: | |
buildplat: | |
- [ubuntu-22.04, manylinux_x86_64] | |
- [ubuntu-22.04, musllinux_x86_64] | |
- [ubuntu-22.04, manylinux_aarch64] | |
- [ubuntu-22.04, musllinux_aarch64] | |
- [macos-13, macosx_x86_64] | |
- [macos-15, macosx_arm64] | |
python-version: [cp39, cp310, cp311, cp312] | |
skip: ["${{ github.event_name == 'workflow_call' && inputs.skip }}"] | |
exclude: | |
# musllinux_aarch64 - takes ~1h5m | |
- buildplat: [musllinux_aarch64] | |
skip: true | |
# musllinux_aarch64 - takes ~ 1h5m | |
- buildplat: [musllinux_aarch64] | |
skip: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
with: | |
package-dir: . | |
output-dir: wheelhouse | |
config-file: "{package}/pyproject.toml" | |
env: | |
# select | |
CIBW_BUILD: ${{ matrix.python-version }}-${{ matrix.buildplat[1] }} | |
CIBW_BUILD_VERBOSITY: 1 | |
# linux | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
# manylinux2014 can't build on aarch64 | |
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 | |
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2 | |
CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2 | |
CIBW_ARCHS_LINUX: auto64 aarch64 | |
CIBW_BEFORE_BUILD_LINUX: "{project}/ci/linux-deps" | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64" && auditwheel repair -w {dest_dir} {wheel}' | |
# macos | |
CIBW_ARCHS_MACOS: auto64 | |
CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps" | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" | |
CIBW_TEST_COMMAND: > | |
if (cd ~/ && python -c "import pybwa") | |
then | |
echo "Import pybwa: OK" | |
else | |
exit 1 | |
fi | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pybwa-${{ matrix.python-version }}-${{ matrix.buildplat[1] }} | |
path: ./wheelhouse/*.whl | |
if-no-files-found: error |