-
Notifications
You must be signed in to change notification settings - Fork 6
360 lines (355 loc) · 13.6 KB
/
test.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
name: tests
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: micromamba-shell {0}
env:
PYSYN_CDBS: /tmp/trds
jref: https://ssb.stsci.edu/trds_open/jref
lref: https://ssb.stsci.edu/cdbs/lref
CRDS_PATH: /tmp/crds_cache
CRDS_CLIENT_RETRY_COUNT: 3
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20
LD_LIBRARY_PATH: /usr/local/lib
jobs:
build:
uses: ./.github/workflows/build.yaml
test_installed:
needs: [ build, crds_contexts ]
strategy:
fail-fast: false
matrix:
package: [ acstools, asdf, ccdproc, costools, jwst, reftools, synphot, wfpc2tools ]
# the macOS 13 runner is on Intel hardware
runs-on: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
include:
- package: acstools
test-dependencies: >-
matplotlib
scipy
scikit-image
stsci.tools
stsci.imagestats
photutils
dask
pytest
pytest-astropy-header
pytest-remotedata
ci-watson
pytest-args: --remote-data -v
- package: asdf
test-dependencies: >-
"lz4>=0.10"
"fsspec[http]>=2022.8.2"
"lz4>=0.10"
psutil
"pytest>=8"
pytest-remotedata
pytest-args: --remote-data --durations=10
- package: ccdproc
test-dependencies: >-
pytest-astropy>=0.10.0
memory_profiler
pytest-args: -W ignore
- package: costools
test-dependencies: >-
pytest
pytest-cov
- package: jwst
test-dependencies: >-
"ci-watson>=0.5.0"
"colorama>=0.4.1"
"readchar>=3.0"
ruff
"pytest>=6.0.0"
"pytest-cov>=2.9.0"
"pytest-doctestplus>=0.10.0"
"requests_mock>=1.0"
crds-observatory: jwst
- package: pysynphot
test-dependencies: >-
pytest
pytest-remotedata
- package: reftools
test-dependencies: >-
pytest-remotedata
pytest-astropy-header
- package: synphot
test-dependencies: >-
pytest-astropy
- package: wfpc2tools
exclude:
- runs-on: macos-13
python-version: '3.10'
- runs-on: macos-13
python-version: '3.11'
- runs-on: macos-latest
python-version: '3.10'
- runs-on: macos-latest
python-version: '3.11'
runs-on: ${{ matrix.runs-on }}
name: "`pytest --pyargs ${{ matrix.package }} -n auto ${{ matrix.pytest-args }}` (${{ matrix.runs-on }}, py${{ matrix.python-version }})"
steps:
- if: matrix.crds-observatory != ''
run: |
echo CRDS_OBSERVATORY=${{ matrix.crds-observatory }} >> $GITHUB_ENV
echo CRDS_SERVER_URL=https://${{ matrix.crds-observatory }}-crds.stsci.edu >> $GITHUB_ENV
echo CRDS_CONTEXT=${{ matrix.crds-observatory == 'hst' && needs.crds_contexts.outputs.hst || matrix.crds-observatory == 'jwst' && needs.crds_contexts.outputs.jwst || matrix.crds-observatory == 'roman' && needs.crds_contexts.outputs.roman || '' }} >> $GITHUB_ENV
shell: bash
- if: env.CRDS_CONTEXT != ''
uses: actions/cache@v4
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ matrix.package }}-${{ env.CRDS_CONTEXT }}
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-downloads-key: downloads-${{ needs.build.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.build.outputs.date }}
init-shell: none
generate-run-shell: true
- run: pip install ${{ matrix.test-dependencies }} pytest pytest-xdist
- run: pip list
- run: pytest --pyargs ${{ matrix.package }} ${{ matrix.pytest-args }} -n auto
test_from_source:
needs: [ build, crds_contexts ]
strategy:
matrix:
package: [ hstcal, calcos ]
# the macOS 13 runner is on Intel hardware
runs-on: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
include:
- package: calcos
repository: spacetelescope/calcos
test-dependencies: >-
ci-watson
pytest
pytest-cov
pytest-args: --slow
- package: drizzlepac
repository: spacetelescope/drizzlepac
test-dependencies: >-
ci_watson
crds
pytest
pytest-remotedata
- package: hstcal
repository: spacetelescope/hstcal
test-dependencies: >-
crds
ci_watson
pytest-args: --slow
test-directory: tests
crds-observatory: hst
- package: stistools
repository: spacetelescope/stistools
- package: stsynphot
repository: spacetelescope/stsynphot_refactor
test-dependencies: >-
pytest-astropy
ci-watson
exclude:
- runs-on: macos-13
python-version: '3.10'
- runs-on: macos-13
python-version: '3.11'
- runs-on: macos-latest
python-version: '3.10'
- runs-on: macos-latest
python-version: '3.11'
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: "`pytest ${{ matrix.package }}/${{ matrix.test-directory }} ${{ matrix.pytest-args }} -n auto` (${{ matrix.runs-on }}, py${{ matrix.python-version }})"
steps:
- if: matrix.crds-observatory != ''
run: |
echo CRDS_OBSERVATORY=${{ matrix.crds-observatory }} >> $GITHUB_ENV
echo CRDS_SERVER_URL=${{ matrix.crds-observatory }}-crds.stsci.edu >> $GITHUB_ENV
echo CRDS_CONTEXT=${{ matrix.crds-observatory == 'hst' && needs.crds_contexts.outputs.hst || matrix.crds-observatory == 'jwst' && needs.crds_contexts.outputs.jwst || matrix.crds-observatory == 'roman' && needs.crds_contexts.outputs.roman || '' }} >> $GITHUB_ENV
shell: bash
- if: env.CRDS_CONTEXT != ''
uses: actions/cache@v4
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ matrix.package }}-${{ env.CRDS_CONTEXT }}
- uses: actions/checkout@v4
with:
path: stenv
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: stenv/environment.yaml
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-downloads-key: downloads-${{ needs.build.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.build.outputs.date }}
init-shell: none
generate-run-shell: true
- run: echo "version=$(pip list | awk '$1 == "${{ matrix.package }}" {print $2}')" >> $GITHUB_OUTPUT
id: package_version
# TODO: figure out a better way to use package version when checking out a Git ref
- uses: actions/checkout@v4
with:
path: ${{ matrix.package }}
repository: ${{ matrix.repository }}
ref: ${{ steps.package_version.outputs.version }}
fetch-depth: 0
- run: pip install ${{ matrix.test-dependencies }} pytest pytest-xdist
- run: pip list
- if: matrix.pre_command != ''
run: ${{ matrix.pre_command }}
working-directory: ${{ matrix.package }}
- run: pytest ${{ matrix.test-directory }} ${{ matrix.pytest-args }} -n auto
working-directory: ${{ matrix.package }}
crds_contexts:
uses: spacetelescope/crds/.github/workflows/contexts.yml@master
crds_test_cache:
uses: spacetelescope/crds/.github/workflows/cache.yml@master
test_crds_with_data:
needs: [ build, crds_test_cache ]
strategy:
fail-fast: false
matrix:
package: [ crds ]
# the macOS 13 runner is on Intel hardware
runs-on: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
include:
- package: crds
repository: spacetelescope/crds
exclude:
- runs-on: macos-13
python-version: '3.10'
- runs-on: macos-13
python-version: '3.11'
- runs-on: macos-latest
python-version: '3.10'
- runs-on: macos-latest
python-version: '3.11'
runs-on: ${{ matrix.runs-on }}
name: "`crds` `./runtests --cover` (${{ matrix.runs-on }}, py${{ matrix.python-version }})"
env:
CRDS_PATH: /tmp/crds-cache-default-test
CRDS_TEST_ROOT: /tmp
CRDS_TESTING_CACHE: /tmp/crds-cache-test
CRDS_SERVER_URL: https://hst-crds.stsci.edu
steps:
- uses: actions/checkout@v4
with:
path: stenv
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: stenv/environment.yaml
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-downloads-key: downloads-${{ needs.build.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.build.outputs.date }}
init-shell: none
generate-run-shell: true
- run: micromamba install -y filelock requests
- run: pip install parsely roman-datamodels git+https://github.com/spacetelescope/jwst
- run: pip list
- run: echo "version=$(pip list | awk '$1 == "${{ matrix.package }}" {print $2}')" >> $GITHUB_OUTPUT
id: package_version
# TODO: figure out a better way to use package version when checking out a Git ref
- uses: actions/checkout@v4
with:
path: ${{ matrix.package }}
repository: ${{ matrix.repository }}
ref: ${{ steps.package_version.outputs.version }}
fetch-depth: 0
- run: pip uninstall --yes crds && ./install && pip install .[submission,test,docs,synphot]
working-directory: ${{ matrix.package }}
- uses: actions/cache@v4
with:
path: |
${{ needs.crds_test_cache.outputs.path }}
${{ needs.crds_test_cache.outputs.testing_cache }}
key: ${{ needs.crds_test_cache.outputs.key }}
- run: ./runtests --cover
working-directory: ${{ matrix.package }}
test_for_smoke:
needs: [ build ]
strategy:
matrix:
package: [ calcos, drizzlepac ]
# the macOS 13 runner is on Intel hardware
runs-on: [ ubuntu-latest, macos-13, macos-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
include:
- package: calcos
run: calcos la8n01qkq_rawtag_a.fits
crds-observatory: hst
jref: hst/references/hst
- package: drizzlepac
run: pytest -n auto tests/test_drizzlepac.py
crds-observatory: hst
jref: hst/references/hst
exclude:
- runs-on: macos-13
python-version: '3.10'
- runs-on: macos-13
python-version: '3.11'
- runs-on: macos-latest
python-version: '3.10'
- runs-on: macos-latest
python-version: '3.11'
fail-fast: false
runs-on: ${{ matrix.runs-on }}
name: "`${{ matrix.run }}` (${{ matrix.runs-on }}, py${{ matrix.python-version }})"
env:
jref: /tmp/crds_cache/${{ matrix.jref }}
steps:
- if: matrix.crds-observatory != ''
run: |
echo CRDS_OBSERVATORY=${{ matrix.crds-observatory }} >> $GITHUB_ENV
echo CRDS_SERVER_URL=${{ matrix.crds-observatory }}-crds.stsci.edu >> $GITHUB_ENV
echo CRDS_CONTEXT=${{ matrix.crds-observatory == 'hst' && needs.crds_contexts.outputs.hst || matrix.crds-observatory == 'jwst' && needs.crds_contexts.outputs.jwst || matrix.crds-observatory == 'roman' && needs.crds_contexts.outputs.roman || '' }} >> $GITHUB_ENV
shell: bash
- if: env.CRDS_CONTEXT != ''
uses: actions/cache@v4
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ matrix.package }}-${{ env.CRDS_CONTEXT }}
- uses: actions/checkout@v4
with:
lfs: true
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-downloads-key: downloads-${{ needs.build.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.build.outputs.date }}
init-shell: none
generate-run-shell: true
- run: pip install pytest-xdist
- if: matrix.test-dependencies != ''
run: pip install ${{ matrix.test-dependencies }}
- run: pip list
- uses: actions/cache@v4
with:
path: tests/data/
key: data-${{ hashFiles('tests/data/*') }}
- run: ${{ matrix.run }}