Skip to content

Added CI for pre-built wheels #1392

Added CI for pre-built wheels

Added CI for pre-built wheels #1392

Workflow file for this run

name: Python
on:
push:
branches:
- master
paths:
- ".github/workflows/build_python.yml"
- "**.cpp"
- "**.h"
- "**.c"
- "**.cu"
- "**.cmake"
- "**CMakeLists.txt"
- "**py"
pull_request:
branches:
- master
paths:
- ".github/workflows/build_python.yml"
- "**.cpp"
- "**.h"
- "**.c"
- "**.cu"
- "**.cmake"
- "**CMakeLists.txt"
- "**py"
defaults:
run:
shell: bash
jobs:
build_wheels:
runs-on: ${{ matrix.platform_arch[1] }}
name: Build ${{matrix.cpython}}-${{ matrix.platform_arch[0] }}
env:
identifier: ${{matrix.cpython}}-${{ matrix.platform_arch[0] }}
strategy:
fail-fast: false
matrix:
cpython: [cp37, cp38, cp39, cp310, cp311, cp312]
platform_arch:
- [manylinux_x86_64, ubuntu-latest]
- [musllinux_x86_64, ubuntu-latest]
- [macosx_x86_64, macos-13]
- [macosx_arm64, macos-14]
- [win_amd64, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Disable gui support
run: |
sed -i'' -e "s/_cmake_extra_options = \[\]/_cmake_extra_options = \['-DDLIB_NO_GUI_SUPPORT=ON'\]/" setup.py
- name: Build wheel
uses: pypa/cibuildwheel@v2.17.0 # sync version with pip install cibuildwheel above
with:
only: ${{ env.identifier }}
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest numpy
CIBW_TEST_COMMAND: python -m pytest {project}/tools/python/test --ignore docs --ignore dlib
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ env.identifier }}
path: wheelhouse/*.whl