-
Notifications
You must be signed in to change notification settings - Fork 652
294 lines (260 loc) · 8.21 KB
/
deploy.yaml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
name: Build and upload to PyPI
on:
pull_request:
branches:
- "package-*"
push:
branches:
- "package-*"
tags:
- "package-*"
release:
types:
- published
schedule:
# 3 am Tuesdays and Fridays
- cron: "0 3 * * 2,5"
concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build_wheels:
if: "github.repository == 'MDAnalysis/mdanalysis'"
name: Build wheels
runs-on: ${{ matrix.buildplat[0] }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-22.04, manylinux_x86_64, x86_64]
- [macos-11, macosx_*, x86_64]
- [windows-2019, win_amd64, AMD64]
python: ["cp39", "cp310", "cp311", "cp312"]
defaults:
run:
working-directory: ./package
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: package
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_BUILD_VERBOSITY: 1
- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
retention-days: 7
build_sdist:
if: "github.repository == 'MDAnalysis/mdanalysis'"
name: build package source distribution
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ./package
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build sdist
run: pipx run build --sdist
- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v3
with:
path: package/dist/*.tar.gz
retention-days: 7
build_sdist_tests:
if: "github.repository == 'MDAnalysis/mdanalysis'"
name: build test source distribution
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ./testsuite
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build sdist
run: pipx run build --sdist
- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v3
with:
path: testsuite/dist/*.tar.gz
retention-days: 7
upload_testpypi_mdanalysis:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package'))
name: testpypi_upload_mdanalysis
environment:
name: deploy
url: https://test.pypi.org/p/mdanalysis
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist, build_sdist_tests]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: move_test_dist
run: |
mkdir -p testsuite/dist
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_source_and_wheels
uses: pypa/[email protected]
with:
skip_existing: true
repository_url: https://test.pypi.org/legacy/
upload_testpypi_mdanalysistests:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package'))
name: testpypi_upload_mdanalysistests
environment:
name: deploy
url: https://test.pypi.org/p/mdanalysis
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist, build_sdist_tests]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: move_test_dist
run: |
mkdir -p testsuite/dist
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_tests
uses: pypa/[email protected]
with:
packages_dir: testsuite/dist
skip_existing: true
repository_url: https://test.pypi.org/legacy/
upload_pypi_mdanalysis:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
github.event_name == 'release' && github.event.action == 'published'
name: pypi_upload_mdanalysis
environment:
name: deploy
url: https://pypi.org/p/mdanalysis
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist, build_sdist_tests]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: move_test_dist
run: |
mkdir -p testsuite/dist
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_source_and_wheels
uses: pypa/[email protected]
upload_pypi_mdanalysistests:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
github.event_name == 'release' && github.event.action == 'published'
name: pypi_upload_mdanalysistests
environment:
name: deploy
url: https://pypi.org/p/mdanalysistests
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist, build_sdist_tests]
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: move_test_dist
run: |
mkdir -p testsuite/dist
mv dist/MDAnalysisTests-* testsuite/dist
- name: upload_tests
uses: pypa/[email protected]
with:
packages_dir: testsuite/dist
check_testpypi:
if: |
github.repository == 'MDAnalysis/mdanalysis' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package'))
name: testpypi check
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: [upload_testpypi_mdanalysis, upload_testpypi_mdanalysistests]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
type: ["FULL", "MIN"]
exclude:
# Multiple deps don't like windows
- os: windows-latest
type: "FULL"
env:
MPLBACKEND: agg
steps:
- uses: actions/checkout@v4
- name: setup_micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: mda
create-args: >-
python=${{ matrix.python-version }}
packaging
pip
# jaime's shim to avoid pulling down the cudatoolkit
# bioconda for clustalw things
condarc: |
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
- bioconda
- name: install_full_deps
uses: ./.github/actions/setup-deps
if: "matrix.type == 'FULL'"
with:
micromamba: true
full-deps: true
- name: pip_install_mda
run: |
awk '/__version__ =/ {print $3; exit}' package/MDAnalysis/version.py | tr -d \" > version.dat
ver=$(python maintainer/norm_version.py --file version.dat)
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis==$ver
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests==$ver
- name: install_min_deps
if: "matrix.type == 'MIN'"
run: |
pip install pytest-xdist pytest-timeout
- name: run_tests
run: |
pytest --timeout=200 -n auto --pyargs MDAnalysisTests