Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enable updating ref. caches #2455

Merged
merged 9 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading