Build and Test wheels #16
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 and Test wheels | |
on: workflow_dispatch | |
jobs: | |
build_sdist: | |
runs-on: [self-hosted, Windows] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Build sdist | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade nox | |
python -m nox --sessions build_sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.tar.gz | |
build_wheels: | |
name: Build wheels on Python ${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} | |
runs-on: ${{ matrix.os }} | |
needs: build_sdist | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
python: 39 | |
platform_id: win_amd64 | |
- os: windows-latest | |
python: 310 | |
platform_id: win_amd64 | |
- os: windows-latest | |
python: 311 | |
platform_id: win_amd64 | |
- os: macos-latest | |
python: 39 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 310 | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: 311 | |
platform_id: macosx_x86_64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.15.0 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
# to supply options, put them in 'env', like: | |
env: | |
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | |
CIBW_ARCHS: all | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_TEST_COMMAND: "pytest {project}/tests" | |
- name: Test wheels | |
continue-on-error: true | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pipx | |
python -m pip install nox | |
python -m nox --sessions test_wheel | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl |