forked from LiberTEM/LiberTEM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-data.yml
238 lines (198 loc) · 7.48 KB
/
azure-pipelines-data.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
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
trigger:
branches:
include:
- master
- 'v*'
resources:
repositories:
- repository: LiberTEM-live
type: github
endpoint: LiberTEM
name: LiberTEM/LiberTEM-live
variables:
- name: PIP_CACHE_DIR
value: $(Pipeline.Workspace)/.pip
- group: Packaging
- group: Coverage
- name: npm_config_cache
value: $(Pipeline.Workspace)/.npm
- name: tox_dir
value: $(Build.Repository.LocalPath)/.tox
parameters:
# by default, the tox environment is kept around, so we need this parameter
# as a way to manually re-create it, in case dependencies change.
- name: recreate_tox
displayName: Recreate tox environments?
type: boolean
default: false
# This parameter allows to run slower tests, this is useful for running more
# comprehensive tests, for example before doing a release. This also enables more
# jobs to build on usually skipped Python versions.
- name: run_slow
displayName: Also run slow tests
type: boolean
default: false
stages:
- stage: test
jobs:
- job: check_example_notebooks
pool: DataAccess
variables:
TESTDATA_BASE_PATH: '/data/'
steps:
- bash: find /data/
displayName: 'list available data'
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
inputs:
versionSpec: '3.9'
# - task: Cache@2
# inputs:
# key: 'python | "$(Agent.OS)" | test_requirements.txt'
# restoreKeys: |
# python | "$(Agent.OS)"
# python
# path: $(PIP_CACHE_DIR)
# displayName: 'cache pip packages'
- bash: python3.9 -m venv venv
displayName: 'create venv'
- bash: ./venv/bin/pip install tox tox-uv
displayName: 'install tox'
- ${{ if eq(parameters.recreate_tox, true) }}:
- bash: ./venv/bin/tox -e notebooks -r -- examples/*.ipynb -v
displayName: 'Run nbval tests $(Agent.OS) (recreating)'
- ${{ if eq(parameters.recreate_tox, false) }}:
- bash: ./venv/bin/tox -e notebooks -- examples/*.ipynb -v
displayName: 'Run nbval tests $(Agent.OS)'
- bash: ./scripts/codecov.sh -f ./coverage.xml
displayName: 'Submit coverage to codecov.io'
${{ if and(not(eq(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: 'junit.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- job: data_tests
pool: DataAccess
strategy:
matrix:
Python39:
python.version: '3.9'
TOXENV: 'py39-data'
Python310:
python.version: '3.10'
TOXENV: 'py310-data'
Python311:
python.version: '3.11'
TOXENV: 'py311-data'
Python312:
python.version: '3.12'
TOXENV: 'py312-data'
variables:
TESTDATA_BASE_PATH: '/data/'
steps:
- bash: find /data/
displayName: 'list available data'
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- bash: python3.9 -m venv venv
displayName: 'create venv'
- bash: ./venv/bin/pip install tox tox-uv
displayName: 'install tox (w/ uv)'
- ${{ if eq(parameters.recreate_tox, true) }}:
- bash: ./venv/bin/tox -r
displayName: 'Run tox tests $(TOXENV) $(Agent.OS) (recreating)'
- ${{ if eq(parameters.recreate_tox, false) }}:
- bash: ./venv/bin/tox
displayName: 'Run tox tests $(TOXENV) $(Agent.OS)'
- ${{ if eq(parameters.run_slow, true) }}:
- bash: ./venv/bin/tox -- -m "slow and not dist" --cov-append
displayName: 'Run tox slow tests $(TOXENV) $(Agent.OS)'
- bash: ./scripts/codecov.sh -f ./coverage.xml
displayName: 'Submit coverage to codecov.io'
${{ if and(not(eq(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: 'junit.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- job: numba_coverage
pool: DataAccess
variables:
TOXENV: 'numba_coverage'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
inputs:
versionSpec: '3.9'
- bash: pip install -U tox tox-uv
displayName: 'install requirements'
- ${{ if eq(parameters.recreate_tox, true) }}:
- bash: tox -r
displayName: 'Run tox tests $(TOXENV) $(Agent.OS) (recreating)'
- ${{ if eq(parameters.recreate_tox, false) }}:
- bash: tox
displayName: 'Run tox tests $(TOXENV) $(Agent.OS)'
- bash: ./scripts/codecov.sh -f ./coverage.xml
displayName: 'Submit coverage to codecov.io'
${{ if and(not(eq(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: 'junit.xml'
testRunTitle: 'Publish test results for numba coverage on Python 3.9'
- job: lint
pool: DataAccess
strategy:
matrix:
docs-check:
TOXENV: 'docs-check'
variables:
TOXENV: '$(TOXENV)'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
inputs:
versionSpec: '3.9'
- bash: apt-get update && apt-get install -y pandoc graphviz
displayName: install required debian packages
- bash: pip install -U tox tox-uv
displayName: 'install requirements'
- ${{ if eq(parameters.recreate_tox, true) }}:
- bash: tox -r
displayName: 'Run tox tests $(TOXENV) $(Agent.OS) (recreating)'
- ${{ if eq(parameters.recreate_tox, false) }}:
- bash: tox
displayName: 'Run tox tests $(TOXENV) $(Agent.OS)'
- job: integration_live
pool: DataAccess
variables:
TESTDATA_BASE_PATH: '/data/'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.9'
inputs:
versionSpec: '3.9'
- checkout: self
- checkout: LiberTEM-live
- bash: python3 -m venv $(Agent.TempDirectory)/venv/
displayName: create virtualenv
- bash: $(Agent.TempDirectory)/venv/bin/pip install uv
displayName: install uv
# FIXME: install with uv, which bugs out with the path right now...
- bash: $(Agent.TempDirectory)/venv/bin/pip install $(Build.SourcesDirectory)/LiberTEM/
displayName: install LiberTEM
- bash: $(Agent.TempDirectory)/venv/bin/pip install "$(Build.SourcesDirectory)/LiberTEM-live/[dectris]"
displayName: install LiberTEM-live
- bash: . $(Agent.TempDirectory)/venv/bin/activate && $(Agent.TempDirectory)/venv/bin/uv pip install -r $(Build.SourcesDirectory)/LiberTEM-live/test_requirements.txt
displayName: install LiberTEM-live test requirements
- bash: cd $(Build.SourcesDirectory)/LiberTEM-live/ && $(Agent.TempDirectory)/venv/bin/pytest
displayName: run LiberTEM-live tests