Skip to content

Commit 787e036

Browse files
allow user to set cache path in workflow call
1 parent 4aafb40 commit 787e036

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/cache.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ name: test cache
22

33
on:
44
workflow_call:
5+
inputs:
6+
path:
7+
description: path to download files to and cache
8+
type: string
9+
required: false
10+
default: ''
511
outputs:
12+
cache_path:
13+
value: ${{ jobs.cache.outputs.cache_path }}
14+
key:
15+
value: ${{ jobs.cache.outputs.cache_key }}
616
path:
7-
value: ${{ jobs.cache.outputs.path }}
17+
value: ${{ jobs.cache.outputs.crds_path }}
818
testing_cache:
919
value: ${{ jobs.cache.outputs.testing_cache }}
10-
key:
11-
value: ${{ jobs.cache.outputs.key }}
1220
workflow_dispatch:
1321
schedule:
1422
# Weekly Monday midnight
@@ -31,7 +39,7 @@ jobs:
3139
name: download and cache CRDS test files
3240
runs-on: ubuntu-latest
3341
steps:
34-
- run: echo CRDS_TEST_ROOT=${{ runner.temp }}/crds >> $GITHUB_ENV
42+
- run: echo CRDS_TEST_ROOT=${{ inputs.path != '' && inputs.path || runner.temp }} >> $GITHUB_ENV
3543
- run: |
3644
echo CRDS_PATH=${{ env.CRDS_TEST_ROOT }}/crds-cache-default-test >> $GITHUB_ENV
3745
echo CRDS_TESTING_CACHE=${{ env.CRDS_TEST_ROOT }}/crds-cache-test >> $GITHUB_ENV
@@ -89,6 +97,7 @@ jobs:
8997
- if: steps.cache.outputs.cache-hit != 'true'
9098
run: ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} ${{ (steps.cache_hst.outputs.cache-hit == 'true' || steps.cache_jwst.outputs.cache-hit == 'true') && 'u' || 'c' }}
9199
outputs:
92-
path: ${{ env.CRDS_PATH }}
93-
testing_cache: ${{ env.CRDS_TESTING_CACHE }}
94-
key: ${{ steps.key.outputs.key }}
100+
cache_path: ${{ env.CRDS_TEST_ROOT }}
101+
cache_key: ${{ steps.key.outputs.key }}
102+
crds_path: ${{ env.CRDS_PATH }}
103+
crds_testing_cache: ${{ env.CRDS_TESTING_CACHE }}

0 commit comments

Comments
 (0)