-
Notifications
You must be signed in to change notification settings - Fork 523
106 lines (99 loc) · 3.72 KB
/
nightlies.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
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 }}