Skip to content

Commit

Permalink
Merge pull request #883 from zacharyburnett/ci/general_cache_path
Browse files Browse the repository at this point in the history
[CI] set a generalized cache path, allowing multiple data caches to be combined downstream
  • Loading branch information
mperrin authored Jul 16, 2024
2 parents 6b65649 + 15376a6 commit fb4dd05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ jobs:
- name: Get WebbPSF Data
uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/webbpsf-data
path: ${{ needs.retrieve_cache.outputs.cache_path }}
key: ${{ needs.retrieve_cache.outputs.cache_key }}

- name: Set WebbPSF data path
run: echo "WEBBPSF_PATH=${{ runner.temp }}/webbpsf-data" >> $GITHUB_ENV
run: echo "WEBBPSF_PATH=${{ needs.retrieve_cache.outputs.cache_path }}/webbpsf-data/" >> $GITHUB_ENV

- name: Check conda info
run: conda info
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/download_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: wget ${{ (github.event_name == 'schedule' || github.event_name == 'release') && env.MINIMAL_DATA_URL || inputs.minimal && env.MINIMAL_DATA_URL || env.DATA_URL }} -O ${{ runner.temp }}/webbpsf-data.tar.gz
- run: tar -xzvf ${{ runner.temp }}/webbpsf-data.tar.gz -C ${{ runner.temp }}
- run: tar -xzvf ${{ runner.temp }}/webbpsf-data.tar.gz -C ${{ runner.temp }}/data/
- id: cache_path
run: echo cache_path=${{ runner.temp }}/webbpsf-data >> $GITHUB_OUTPUT
run: echo cache_path=${{ runner.temp }}/data/ >> $GITHUB_OUTPUT
- id: version
run: echo "version=$(cat ${{ steps.cache_path.outputs.cache_path }}/version.txt)" >> $GITHUB_OUTPUT
- id: cache_key
run: echo "cache_key=webbpsf-data-${{ (github.event_name == 'schedule' || github.event_name == 'release') && 'mini' || inputs.minimal && 'mini' || 'full' }}-${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT
- uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/webbpsf-data
path: ${{ runner.temp }}/data/
key: ${{ steps.cache_key.outputs.cache_key }}
outputs:
version: ${{ steps.version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/retrieve_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ jobs:
run: echo "version=$(echo ${{ steps.latest_cache_key.outputs.cache_key }} | awk -F '-' '{print $4}')" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.version.outputs.version }}
cache_path: ${{ runner.temp }}/webbpsf-data
cache_path: ${{ runner.temp }}/data/
cache_key: ${{ steps.latest_cache_key.outputs.cache_key }}

0 comments on commit fb4dd05

Please sign in to comment.