Skip to content

use reusable workflow from WebbPSF repository to download and cache data #1

use reusable workflow from WebbPSF repository to download and cache data

use reusable workflow from WebbPSF repository to download and cache data #1

Workflow file for this run

name: download and cache data
on:
schedule:
- cron: "42 4 * * 3"
workflow_dispatch:
inputs:
webbpsf_minimal:
description: minimal WebbPSF dataset
type: boolean
required: false
default: true
pull_request:
jobs:
download_webbpsf_data:
uses: spacetelescope/webbpsf/.github/workflows/download_data.yml@develop
with:
minimal: ${{ github.event_name == 'schedule' && true || inputs.webbpsf_minimal }}
combine_data_cache:
needs: [ download_webbpsf_data ]
runs-on: ubuntu-latest
env:
GALSIM_DATA_URL: https://github.com/GalSim-developers/GalSim/raw/releases/2.4/examples/data/
steps:
- run: |
mkdir ./galsim_data/
wget ${{ env.GALSIM_DATA_URL }}/real_galaxy_catalog_23.5_example.fits -O ./galsim_data/real_galaxy_catalog_23.5_example.fits
wget ${{ env.GALSIM_DATA_URL }}/real_galaxy_catalog_23.5_example_selection.fits -O ./galsim_data/real_galaxy_catalog_23.5_example_selection.fits
wget ${{ env.GALSIM_DATA_URL }}/real_galaxy_catalog_23.5_example_fits.fits -O ./galsim_data/real_galaxy_catalog_23.5_example_fits.fits
- id: galsim_data_hash
run: echo "hash=${{ hashFiles( './galsim_data/' ) }}" >> $GITHUB_OUTPUT
- run: mv ./galsim_data/ ${{ runner.temp }}/data/
- run: echo "GALSIM_CAT_PATH=${{ runner.temp }}/data/galsim_data/real_galaxy_catalog_23.5_example.fits" >> $GITHUB_OUTPUT
- run: mkdir ${{ runner.temp }}/data/
- uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/data/webbpsf-data/
key: ${{ needs.download_webbpsf_data.outputs.cache_key }}
- uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/data/
key: data-${{ needs.download_webbpsf_data.outputs.cache_key }}-galsim-data-${{ steps.galsim_data_hash.outputs.hash }}