Skip to content

Commit

Permalink
cache based on date
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Feb 1, 2024
1 parent c0320dc commit c5c02bb
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@ concurrency:

defaults:
run:
shell: bash -l {0}
shell: micromamba-shell {0}

jobs:
date:
runs-on: ubuntu-latest
steps:
- run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
id: date
shell: bash
outputs:
date: ${{ steps.date.outputs.date }}
build:
name: build environment
runs-on: ubuntu-latest
Expand All @@ -34,9 +42,12 @@ jobs:
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: none
generate-run-shell: true
- run: python ./00_install/verify_install.py
- run: conda env export > roman-data-workshop-env-${{ github.sha }}.yml
- uses: actions/[email protected]
Expand All @@ -60,9 +71,12 @@ jobs:
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: none
generate-run-shell: true
if: steps.data_cache.outputs.cache-hit != 'true'
- run: python data/download.py
if: steps.data_cache.outputs.cache-hit != 'true'
Expand All @@ -83,9 +97,12 @@ jobs:
environment-file: 00_install/environment.yml
create-args: >-
conda
cache-environment: true
cache-downloads: true
init-shell: bash
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: none
generate-run-shell: true
- run: echo "name=crds_context::$(crds list --operational-context)" >> $GITHUB_OUTPUT
id: crds_context
- uses: actions/cache@v3
Expand Down

0 comments on commit c5c02bb

Please sign in to comment.