1
- name : test cache
1
+ name : download CRDS test cache
2
2
3
3
on :
4
4
workflow_call :
43
43
repository : spacetelescope/crds
44
44
- id : key
45
45
run : echo "key=test-cache-${{ needs.contexts.outputs.hst }}-${{ needs.contexts.outputs.jwst }}" >> $GITHUB_OUTPUT
46
- - id : lookup-combined- cache
46
+ - id : lookup-cache
47
47
name : check for existence of combined CRDS cache (`${{ steps.key.outputs.key }}`)
48
48
uses : actions/cache/restore@v4
49
49
with :
@@ -52,26 +52,22 @@ jobs:
52
52
${{ env.CRDS_TESTING_CACHE }}
53
53
key : ${{ steps.key.outputs.key }}
54
54
lookup-only : true
55
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
56
- id : crds-cache-test
55
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
56
+ id : retrieve-previous-cache
57
+ name : retrieve a previous combined CRDS cache
58
+ uses : actions/cache/restore@v4
59
+ with :
60
+ path : |
61
+ ${{ env.CRDS_PATH }}
62
+ ${{ env.CRDS_TESTING_CACHE }}
63
+ key : ${{ steps.key.outputs.key }}
64
+ restore-keys : |
65
+ test-cache-
66
+ - if : steps.retrieve-previous-cache.outputs.cache-matched-key == ''
57
67
run : |
58
68
git clone https://github.com/spacetelescope/crds-cache-test.git
59
69
mv crds-cache-test ${{ env.CRDS_TEST_ROOT }}
60
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
61
- id : retrieve-hst-cache
62
- name : retrieve HST CRDS cache (`test-cache-${{ needs.contexts.outputs.hst }}`)
63
- uses : actions/cache@v4
64
- with :
65
- path : ${{ env.CRDS_PATH }}/**/hst*
66
- key : test-cache-${{ needs.contexts.outputs.hst }}
67
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
68
- id : retrieve-jwst-cache
69
- name : retrieve JWST CRDS cache (`test-cache-${{ needs.contexts.outputs.jwst }}`)
70
- uses : actions/cache@v4
71
- with :
72
- path : ${{ env.CRDS_PATH }}/**/jwst*
73
- key : test-cache-${{ needs.contexts.outputs.jwst }}
74
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
70
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
75
71
uses : mamba-org/setup-micromamba@v2
76
72
with :
77
73
environment-name : crds-testing
@@ -87,13 +83,13 @@ jobs:
87
83
init-shell : bash
88
84
cache-environment : true
89
85
cache-downloads : true
90
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
86
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
87
+ run : ./install
88
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
91
89
run : pip install git+https://github.com/spacetelescope/jwst roman-datamodels
92
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
93
- run : pip uninstall --yes crds && ./install && pip install .
94
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
95
- run : ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} ${{ (steps.retrieve-hst-cache.outputs.cache-hit == 'true' || steps.retrieve-jwst-cache.outputs.cache-hit == 'true') && 'u' || 'c' }}
96
- - if : steps.lookup-combined-cache.outputs.cache-hit != 'true'
90
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
91
+ run : ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} u
92
+ - if : steps.lookup-cache.outputs.cache-hit != 'true'
97
93
name : save combined CRDS cache (`${{ steps.key.outputs.key }}`)
98
94
uses : actions/cache/save@v4
99
95
with :
0 commit comments