-
Notifications
You must be signed in to change notification settings - Fork 27
132 lines (125 loc) · 3.56 KB
/
cibuildwheel.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- 'docs/**'
push:
branches:
- main
release:
types:
- published
jobs:
style:
name: Check style
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: pre-commit/[email protected]
build_wheels:
needs: style
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04-arm, windows-2022, macos-15, macos-13]
fail-fast: false
timeout-minutes: 10 # Linux ~1 min, Windows ~4 min
name: cibuildwheel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build wheels and run tests
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: ./wheelhouse/*.whl
test:
needs: build_wheels
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04-arm, windows-2022, macos-15, macos-13]
python-version: ['3.12']
include:
- os: ubuntu-22.04
python-version: '3.13'
fail-fast: false
name: Test wheels (${{ matrix.os }} py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 5
defaults:
run:
shell: bash -eo pipefail {0}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
pattern: artifact-${{ matrix.os }}
merge-multiple: true
path: dist
- run: ls -al dist
- run: python -m pip install ./dist/*.whl pytest pytest-cov edfio wfdb numba pytest-error-for-skips --only-binary="numpy,numba,llvmlite,edfio"
- run: pytest -rfEXs --cov=sleepecg --cov-report=xml --tb=short --cov-branch --color=yes --error-for-skips tests/
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success() || failure()
build_sdist:
needs: style
name: Build source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.12
- name: Build sdist
run: |
set -eo pipefail
python -m pip install build numpy
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz
check_wheels:
needs: [build_wheels, build_sdist]
name: Check wheels and source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist
- run: ls -al dist
shell: bash
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: python -m pip install twine
- run: python -m twine check --strict dist/*
upload-pypi:
name: Upload to PyPI
needs: [check_wheels, test]
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist
- uses: pypa/[email protected]