Skip to content

Fix several test failures at head in complex tests. #500

Fix several test failures at head in complex tests.

Fix several test failures at head in complex tests. #500

Workflow file for this run

name: Build
on:
workflow_dispatch: {} # allows triggering this workflow manually
push:
branches: # trigger on commits to main branch
- main
pull_request: # trigger on pull requests affecting relevant files
branches:
- main
paths:
- '**workflows/wheels.yml'
- 'pyproject.toml'
release: # trigger on published release
types:
- published
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14, windows-2022]
cibw_build: ["cp310-* cp311-* cp312-* cp313-* cp313t-* cp314-* cp314t-*"]
include:
- os: windows-11-arm
cibw_build: "cp311-* cp312-* cp313-* cp313t-* cp314-* cp314t-*"
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: true
persist-credentials: false
# Used to host cibuildwheel
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.1.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: universal2
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ENABLE: cpython-freethreading
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: "*musllinux* *i686* *win32*"
CIBW_TEST_REQUIRES: absl-py pytest pytest-xdist
CIBW_TEST_COMMAND: pytest -n auto {project}
CIBW_BUILD_VERBOSITY: 1
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
submodules: true
persist-credentials: false
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cibw-sdist
path: dist/*.tar.gz
download_and_list_artifacts:
# Helps debug issues like https://github.com/jax-ml/ml_dtypes/issues/196
name: Download and list artifacts
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: List files
run: ls -l dist/
upload_pypi:
name: Release & Upload to PyPI
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
# Only publish release to PyPI when a github release is created.
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: List files
run: ls -l dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0