diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69e534a..11f2c78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,10 +36,10 @@ jobs: - eigen - fftw setenv: | - WEBBPSF_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}webbpsf-data/ - GALSIM_CAT_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}galsim_data/real_galaxy_catalog_23.5_example.fits + WEBBPSF_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}/data/webbpsf-data/ + GALSIM_CAT_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}/data/galsim_data/real_galaxy_catalog_23.5_example.fits FFTW_DIR: /opt/homebrew/opt/fftw/lib/ - cache-path: ${{ needs.latest_data_cache.outputs.cache_path }} + cache-path: ${{ needs.latest_data_cache.outputs.cache_path }}/data cache-key: ${{ needs.latest_data_cache.outputs.cache_key }} envs: | - linux: py310-oldestdeps-cov-xdist diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index cbb25b3..4a3b624 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -25,8 +25,8 @@ jobs: - eigen - fftw setenv: | - WEBBPSF_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}webbpsf-data/ - GALSIM_CAT_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}galsim_data/real_galaxy_catalog_23.5_example.fits + WEBBPSF_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}/webbpsf-data/ + GALSIM_CAT_PATH: ${{ needs.latest_data_cache.outputs.cache_path }}/galsim_data/real_galaxy_catalog_23.5_example.fits FFTW_DIR: /opt/homebrew/opt/fftw/lib/ cache-path: ${{ needs.latest_data_cache.outputs.cache_path }} cache-key: ${{ needs.latest_data_cache.outputs.cache_key }} diff --git a/.github/workflows/data.yml b/.github/workflows/data.yml index 34d75a5..0fb161b 100644 --- a/.github/workflows/data.yml +++ b/.github/workflows/data.yml @@ -37,6 +37,8 @@ jobs: env: GALSIM_DATA_URL: https://github.com/GalSim-developers/GalSim/raw/releases/2.4/examples/data/ steps: + - id: cache_path + run: echo path=${{ inputs.cache_path != '' && inputs.cache_path || format('{0}/data', runner.temp) }} >> $GITHUB_OUTPUT - name: download GalSim data run: | mkdir galsim_data @@ -45,7 +47,7 @@ jobs: 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 run: echo "hash=${{ hashFiles( 'galsim_data/' ) }}" >> $GITHUB_OUTPUT - - run: echo GALSIM_PATH=${{ runner.temp }}/data/galsim_data/ >> $GITHUB_ENV + - run: echo GALSIM_PATH=${{ steps.cache_path.outputs.path }}/galsim_data/ >> $GITHUB_ENV - run: | mkdir -p ${{ env.GALSIM_PATH }} mv ./galsim_data/* ${{ env.GALSIM_PATH }} @@ -55,18 +57,17 @@ jobs: with: path: ${{ needs.download_webbpsf_data.outputs.cache_path }} key: ${{ needs.download_webbpsf_data.outputs.cache_key }} - - run: mv ${{ needs.download_webbpsf_data.outputs.cache_path }}/webbpsf-data/ ${{ runner.temp }}/data/ - - run: echo WEBBPSF_PATH=${{ runner.temp }}/data/webbpsf-data/ >> $GITHUB_ENV - - id: cache - run: | - echo path=${{ inputs.cache_path != '' && inputs.cache_path || format('{0}/data', runner.temp) }} >> $GITHUB_OUTPUT - echo key=data-${{ needs.download_webbpsf_data.outputs.cache_key }}-galsim-data-${{ steps.galsim_data.outputs.hash }} >> $GITHUB_OUTPUT + - run: mv ${{ needs.download_webbpsf_data.outputs.cache_path }}/webbpsf-data/ ${{ steps.cache_path.outputs.path }}/ + continue-on-error: true + - run: echo WEBBPSF_PATH=${{ steps.cache_path.outputs.path }}/webbpsf-data/ >> $GITHUB_ENV + - id: cache_key + run: echo key=data-${{ needs.download_webbpsf_data.outputs.cache_key }}-galsim-data-${{ steps.galsim_data.outputs.hash }} >> $GITHUB_OUTPUT # save a new cache to the same generalized data directory, combined with extra data - name: save a single combined data cache uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: - path: ${{ steps.cache.outputs.path }} - key: ${{ steps.cache.outputs.key }} + path: ${{ steps.cache_path.outputs.path }} + key: ${{ steps.cache_key.outputs.key }} outputs: - cache_key: ${{ steps.cache.outputs.key }} - cache_path: ${{ steps.cache.outputs.path }} + cache_key: ${{ steps.cache_path.outputs.key }} + cache_path: ${{ steps.cache_key.outputs.path }} diff --git a/.github/workflows/retrieve_cache.yml b/.github/workflows/retrieve_cache.yml index 35deffa..14262c4 100644 --- a/.github/workflows/retrieve_cache.yml +++ b/.github/workflows/retrieve_cache.yml @@ -2,6 +2,11 @@ name: retrieve latest data cache key on: workflow_call: + inputs: + cache_path: + type: string + required: false + default: "" outputs: cache_key: value: ${{ jobs.retrieve_cache.outputs.cache_key }} @@ -13,6 +18,8 @@ jobs: name: retrieve latest data cache key runs-on: ubuntu-latest steps: + - id: cache_path + run: echo cache_path=${{ inputs.cache_path != '' && inputs.cache_path || format('{0}/data', runner.temp) }} >> $GITHUB_OUTPUT - name: retrieve latest data cache key id: latest_cache_key run: | @@ -24,8 +31,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} - run: echo cache_key=${{ steps.latest_cache_key.outputs.cache_key }} - - id: cache_path - run: echo cache_path=${{ runner.temp }}/data/ >> $GITHUB_OUTPUT + - run: echo cache_path=${{ steps.cache_path.outputs.cache_path }} outputs: cache_key: ${{ steps.latest_cache_key.outputs.cache_key }} cache_path: ${{ steps.cache_path.outputs.cache_path }}