Skip to content

Commit

Permalink
allow user to set cache path in workflow call
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Aug 2, 2024
1 parent a389a6e commit c88c0ae
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ name: test cache

on:
workflow_call:
inputs:
path:
description: path to download files to and cache
type: string
required: false
default: ''
outputs:
cache_path:
value: ${{ jobs.cache.outputs.cache_path }}
key:
value: ${{ jobs.cache.outputs.cache_key }}
path:
value: ${{ jobs.cache.outputs.path }}
value: ${{ jobs.cache.outputs.crds_path }}
testing_cache:
value: ${{ jobs.cache.outputs.testing_cache }}
key:
value: ${{ jobs.cache.outputs.key }}
workflow_dispatch:
schedule:
# Weekly Monday midnight
Expand All @@ -31,7 +39,7 @@ jobs:
name: download and cache CRDS test files
runs-on: ubuntu-latest
steps:
- run: echo CRDS_TEST_ROOT=${{ runner.temp }}/crds >> $GITHUB_ENV
- run: echo CRDS_TEST_ROOT=${{ inputs.path != '' && inputs.path || runner.temp }} >> $GITHUB_ENV
- run: |
echo CRDS_PATH=${{ env.CRDS_TEST_ROOT }}/crds-cache-default-test >> $GITHUB_ENV
echo CRDS_TESTING_CACHE=${{ env.CRDS_TEST_ROOT }}/crds-cache-test >> $GITHUB_ENV
Expand Down Expand Up @@ -89,6 +97,7 @@ jobs:
- if: steps.cache.outputs.cache-hit != 'true'
run: ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} ${{ (steps.cache_hst.outputs.cache-hit == 'true' || steps.cache_jwst.outputs.cache-hit == 'true') && 'u' || 'c' }}
outputs:
path: ${{ env.CRDS_PATH }}
testing_cache: ${{ env.CRDS_TESTING_CACHE }}
key: ${{ steps.key.outputs.key }}
cache_path: ${{ env.CRDS_TEST_ROOT }}
cache_key: ${{ steps.key.outputs.key }}
crds_path: ${{ env.CRDS_PATH }}
crds_testing_cache: ${{ env.CRDS_TESTING_CACHE }}

0 comments on commit c88c0ae

Please sign in to comment.