Skip to content

Build wheels for NVTX #16

Build wheels for NVTX

Build wheels for NVTX #16

Workflow file for this run

name: Build wheels for NVTX
on:
workflow_dispatch:
inputs:
branchOrTag:
description: 'Branch or tag to checkout'
required: true
default: 'release-v3'
type: string
prNumber:
description: 'PR number (overrides branch/tag if > 0)'
required: false
type: integer
default: 0
jobs:
build:
name: Build wheels on ${{ matrix.os }} ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: 'ubuntu-latest'
cibw_archs_linux: "x86_64"
docker_py_container: "python"
name: 'ubuntu-x86_64'
- os: 'ubuntu-latest'
cibw_archs_linux: "aarch64"
docker_py_container: "arm64v8/python"
name: 'ubuntu-qemu-aarch64'
qemu: true
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
ref: ${{ inputs.branchOrTag }}
- name: Set up Python
# Only build sdists on x86_64
if: matrix.cibw_archs_linux == 'x86_64'
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build source distribution
# Only build sdists on x86_64
if: matrix.cibw_archs_linux == 'x86_64'
run: |
python3 -m pip install build --user
python3 -m build --sdist --outdir dist/ ./python/
- name: Set up QEMU
if: matrix.qemu
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "*musllinux* cp36-* cp37-*"
CIBW_BUILD: "cp*"
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_TEST_COMMAND: "pytest {package}/nvtx/tests"
CIBW_TEST_REQUIRES: "pytest"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'auditwheel repair -w {dest_dir} {wheel}'
CIBW_ENVIRONMENT: "C_INCLUDE_PATH=$(pwd)/c/include"
with:
output-dir: dist
package-dir: python
- name: Run docker smoke tests for all python versions
run: |
for pyver in 3.8 3.9 3.10 3.11; do
docker run --rm \
-v $(pwd)/dist:/wheels \
${{ matrix.docker_py_container }}:$pyver-bullseye \
sh -c \
"python3 -m pip install --verbose --find-links=file:///wheels --no-index nvtx && python3 -m pip check && python3 -c 'import nvtx; print(nvtx.annotate())';" ;\
done
- name: Upload distributions
uses: actions/upload-artifact@v3
with:
path: dist
name: nvtx-wheels