Skip to content

Commit

Permalink
Update cache weekly (#74)
Browse files Browse the repository at this point in the history
* Update cache weekly

* Add get-week-number to needs of tests
  • Loading branch information
IgorTatarnikov authored Jan 28, 2025
1 parent dd2eb53 commit 2f3ff1f
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ jobs:
steps:
- uses: neuroinformatics-unit/actions/check_manifest@v2

get-week-number:
runs-on: ubuntu-latest
outputs:
WEEK_NUMBER: ${{ steps.get-week-number.outputs.WEEK_NUMBER }}
steps:
- name: Get week number
id: get-week-number
run: echo "WEEK_NUMBER=$(date -u '+%V')" >> "$GITHUB_OUTPUT"

test:
needs: [linting, manifest]
needs: [linting, manifest, get-week-number]
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -55,13 +64,16 @@ jobs:
# cache atlases needed by the tests
- name: Cache Atlases
id: atlas-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: | # ensure we don't cache any interrupted atlas download and extraction!
~/.brainglobe/*
path: | # ensure we don't cache any interrupted atlas download and extraction, if e.g. we cancel the workflow manually
~/.brainglobe
!~/.brainglobe/atlas.tar.gz
key: ${{ runner.os }}-cached-atlases
enableCrossOsArchive: false # ~ and $HOME evaluate to different places across OSs!
key: brainglobe-${{ runner.os }}-${{ needs.get-week-number.outputs.WEEK_NUMBER }}
restore-keys: |
brainglobe-${{ runner.os }}-${{ needs.get-week-number.outputs.WEEK_NUMBER }}
brainglobe-${{ runner.os }}-
brainglobe
- if: ${{ steps.atlas-cache.outputs.cache-hit == 'true' }}
name: List files in brainglobe data folder # good to be able to sanity check that user data is as expected
Expand Down

0 comments on commit 2f3ff1f

Please sign in to comment.