Skip to content

Commit

Permalink
ci: enable updating ref. caches (#2455)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Mar 19, 2024
1 parent c94aadb commit f021b03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .azure/gpu-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,14 @@ jobs:
#py-tree $(PYTEST_REFERENCE_CACHE) --show_hidden
# make sure the cache exists even it is empty
mkdir -p /var/tmp/cached-references
# copy the cache to the tests folder to be used in the next steps
displayName: "Show caches"
- bash: |
cp -r /var/tmp/cached-references tests/_cache-references
du -h --max-depth=1 tests/
displayName: "Show caches"
condition: eq(variables['Build.Reason'], 'PullRequest')
# if pull request, copy the cache to the tests folder to be used in the next steps
displayName: "Copy cached refs"
- bash: |
python -m pytest torchmetrics --cov=torchmetrics \
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/pull-caches/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ runs:
shell: bash

- name: Cache References
# do not use this cache for dispatch and crone, to enable rebuild caches if needed
if: github.event_name != 'workflow_dispatch' && github.event_name != 'schedule'
continue-on-error: true
uses: actions/cache/restore@v3
with:
Expand All @@ -90,5 +92,8 @@ runs:

- name: Restored References
continue-on-error: true
run: py-tree tests/_cache-references/ --show_hidden
working-directory: tests/
run: |
mkdir -p _cache-references
ls -lh _cache-references/
shell: bash

0 comments on commit f021b03

Please sign in to comment.