Skip to content

Commit 7323562

Browse files
committed
fix cache key
1 parent 056e0c2 commit 7323562

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
outputs:
2828
cache-key: ${{steps.cache-key.outputs.cache-key}}
29+
cache-key-light: ${{steps.cache-key.outputs.cache-key}}-light
2930
steps:
3031
- name: Get Date
3132
id: get-date
@@ -163,27 +164,27 @@ jobs:
163164
CACHE_NUMBER: 0
164165
- run: conda list
165166
- name: Pyright
167+
if: matrix.run-expensive-tests
166168
run: |
167169
pyright --version
168170
pyright -p pyproject.toml --pythonversion ${{ matrix.python-version }}
169-
if: matrix.run-expensive-tests
170-
- name: Restore bioimageio cache
171+
- name: Restore bioimageio cache ${{matrix.run-expensive-tests && needs.populate-cache.outputs.cache-key || needs.populate-cache.outputs.cache-key-light}}
171172
uses: actions/cache/restore@v4
172-
id: bioimageio-cache
173173
with:
174174
path: bioimageio_cache
175-
key: ${{needs.populate-cache.outputs.cache-key}}${{matrix.run-expensive-tests && '' || '-light'}}
175+
key: ${{matrix.run-expensive-tests && needs.populate-cache.outputs.cache-key || needs.populate-cache.outputs.cache-key-light}}
176176
- name: pytest
177177
run: pytest --disable-pytest-warnings
178178
env:
179179
BIOIMAGEIO_CACHE_PATH: bioimageio_cache
180180
RUN_EXPENSIVE_TESTS: ${{ matrix.run-expensive-tests && 'true' || 'false' }}
181-
- name: Save updated bioimageio cache
181+
- name: Save bioimageio cache ${{matrix.run-expensive-tests && needs.populate-cache.outputs.cache-key || needs.populate-cache.outputs.cache-key-light}}
182182
if: matrix.save-cache
183183
uses: actions/cache/save@v4
184184
with:
185185
path: bioimageio_cache
186-
key: ${{needs.populate-cache.outputs.cache-key}}${{matrix.run-expensive-tests && '' || '-light'}}
186+
key: ${{matrix.run-expensive-tests && needs.populate-cache.outputs.cache-key || needs.populate-cache.outputs.cache-key-light}}
187+
187188
- if: matrix.report-coverage && github.event_name == 'pull_request'
188189
uses: orgoro/[email protected]
189190
with:

0 commit comments

Comments
 (0)