Wheel building #192
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: Wheel building | |
on: | |
schedule: | |
# run every day at 4am UTC | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
test_wheel_building: | |
# This ensures that a couple of targets work fine in pull requests and pushes | |
permissions: | |
contents: none | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 | |
if: (github.event_name == 'push' || github.event_name == 'pull_request') | |
with: | |
upload_to_pypi: false | |
upload_to_anaconda: false | |
test_extras: test | |
test_command: pytest -p no:warnings --astropy-header -m "not hypothesis" -k "not test_data_out_of_range and not test_set_locale and not TestQuantityTyping" --pyargs astropy | |
targets: | | |
- cp310-manylinux_x86_64 | |
build_and_publish: | |
# This does the actual wheel building and publishing as part of the cron job | |
# or if triggered manually via the workflow dispatch, or for a tag. | |
permissions: | |
contents: none | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 | |
if: (github.repository == 'astropy/astropy' && ( startsWith(github.ref, 'refs/tags/v') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Build all wheels'))) | |
with: | |
# We upload to PyPI for all tags starting with v but not ones ending in .dev | |
upload_to_pypi: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '.dev') && (github.event_name == 'push') }} | |
upload_to_anaconda: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} | |
anaconda_user: astropy | |
anaconda_package: astropy | |
anaconda_keep_n_latest: 10 | |
# For nightly wheels as well as when building with the 'Build all wheels' label, we disable | |
# the build isolation and explicitly install the latest developer version of numpy as well as | |
# the latest stable versions of all other build-time dependencies. | |
env: | | |
CIBW_BEFORE_BUILD: '${{ ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Build all wheels')) && 'pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple setuptools setuptools_scm cython numpy>=0.0.dev0 extension-helpers') || '' }}' | |
CIBW_BUILD_FRONTEND: '${{ ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Build all wheels')) && 'pip; args: --no-build-isolation') || 'build' }}' | |
test_extras: test | |
# FIXME: we exclude the test_data_out_of_range test since it | |
# currently fails, see https://github.com/astropy/astropy/issues/10409 | |
# We also exclude test_set_locale as it sometimes relies on the correct locale | |
# packages being installed, which it isn't always. | |
test_command: pytest -p no:warnings --astropy-header -m "not hypothesis" -k "not test_data_out_of_range and not test_set_locale and not TestQuantityTyping" --pyargs astropy | |
targets: | | |
# Linux wheels | |
- cp310-manylinux_x86_64 | |
- cp311-manylinux_x86_64 | |
- cp312-manylinux_x86_64 | |
# Note that following wheels are not currently tested: | |
- cp310-manylinux_aarch64 | |
- cp311-manylinux_aarch64 | |
- cp312-manylinux_aarch64 | |
- cp310-musllinux_x86_64 | |
- cp311-musllinux_x86_64 | |
- cp312-musllinux_x86_64 | |
# MacOS X wheels - as noted in https://github.com/astropy/astropy/pull/12379 we deliberately | |
# do not build universal2 wheels. | |
- cp310*macosx_x86_64 | |
- cp311*macosx_x86_64 | |
- cp312*macosx_x86_64 | |
- cp310*macosx_arm64 | |
- cp311*macosx_arm64 | |
- cp312*macosx_arm64 | |
# Windows wheels | |
- cp310*win32 | |
- cp311*win32 | |
- cp312*win32 | |
- cp310*win_amd64 | |
- cp311*win_amd64 | |
- cp312*win_amd64 | |
secrets: | |
pypi_token: ${{ secrets.pypi_token }} | |
anaconda_token: ${{ secrets.anaconda_token }} |