Nightly NumPy wheels #32
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: Nightly NumPy wheels | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
cancel-in-progress: true | |
# Adapted from https://github.com/matplotlib/matplotlib/blob/main/.github/workflows/nightlies.yml | |
on: | |
# Run daily at 1:23 UTC to upload nightly wheels to Anaconda Cloud | |
schedule: | |
- cron: '23 1 * * *' | |
# Run on demand with workflow dispatch | |
workflow_dispatch: | |
# Run on all PRs | |
pull_request: | |
permissions: | |
actions: read | |
jobs: | |
build_wheels: | |
name: Build ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# To start, just do Ubuntu. The others should probably be added after doing | |
# some refactoring of CIBW_* vars to pyproject.toml for example, or into | |
# ci/cibw_*.sh scripts. | |
os: [ubuntu-latest] # , windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.16.5 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BEFORE_BUILD: "pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy && pip install \"Cython>=0.29.31,<4\" pkgconfig \"setuptools>=61\"" | |
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" | |
CIBW_BUILD: "cp3{9,10,11,12}-manylinux_x86_64" | |
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/h5py/manylinux2014_x86_64-hdf5 | |
CIBW_ENVIRONMENT: "CFLAGS=-g1" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
test_wheels: | |
name: Test ${{ matrix.os }} ${{ matrix.python }} | |
needs: build_wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] # , windows-latest, macos-13, macos-14] | |
python: ['3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-wheels-${{ matrix.os}}-* | |
merge-multiple: true | |
path: dist | |
- run: ls -alt dist | |
- name: Install tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox codecov | |
- name: Install wheel | |
shell: bash | |
run: | | |
set -eo pipefail | |
export PYVER=$(python -c "import sys; print(''.join(map(str, sys.version_info[:2])))") | |
echo "Using tag $PYVER" | |
export TOXENV="py$PYVER-test-deps,py$PYVER-test-mindeps,$PYVER-test-deps-pre" | |
WHL_PATH=$(python -c "import glob, sys; print(glob.glob(f'dist/h5py-*-cp$PYVER-*.whl')[0])") | |
echo "Will install wheel from $WHL_PATH" | |
tox --installpkg $WHL_PATH | |
- run: python ci/upload_coverage.py --codecov-token 813fb6da-087d-4b36-a185-5a530cab3455 | |
upload_nightly_wheels: | |
name: Upload wheels | |
needs: test_wheels | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'h5py' && github.event_name == 'schedule' | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-wheels-* | |
merge-multiple: true | |
path: dist | |
- run: pwd && ls -alt . && ls -alt dist/ | |
- name: Upload wheels to Anaconda Cloud as nightlies | |
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0 | |
with: | |
artifacts_path: dist | |
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} |