Skip to content

Commit e8286e2

Browse files
committed
only save bioimageio_cache once
1 parent f050601 commit e8286e2

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/build.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
spec: main
4545
run-expensive-tests: true
4646
report-coverage: true
47+
save-cache: true
4748
- python-version: '3.12'
4849
conda-env: dev
4950
spec: conda
@@ -87,12 +88,12 @@ jobs:
8788
- name: Cache env
8889
uses: actions/cache@v4
8990
with:
90-
path: ${{ env.CONDA }}/envs/${{steps.setup.outputs.env-name}}
91+
path: ${{env.CONDA}}/envs/${{steps.setup.outputs.env-name}}
9192
key: >-
92-
conda-${{ runner.os }}-${{ runner.arch }}-
93-
-${{steps.get-date.outputs.today }}-
94-
-${{ hashFiles(matrix.conda-env) }}-
95-
-${{env.CACHE_NUMBER }}
93+
conda-${{runner.os}}-${{runner.arch}}-
94+
-${{steps.get-date.outputs.today}}-
95+
-${{hashFiles(matrix.conda-env)}}-
96+
-${{env.CACHE_NUMBER}}
9697
env:
9798
CACHE_NUMBER: 0
9899
id: cache
@@ -104,9 +105,16 @@ jobs:
104105
pyright
105106
if: matrix.run-expensive-tests
106107
- uses: actions/cache@v4
108+
if: matrix.save-cache
107109
with:
108110
path: bioimageio_cache
109-
key: "test-${{matrix.spec}}-${{ steps.get-date.outputs.date }}"
111+
key: "test-${{matrix.spec}}-${{steps.get-date.outputs.date}}"
112+
- uses: actions/cache/restore@v4
113+
if: ${{!matrix.save-cache}}
114+
with:
115+
path: bioimageio_cache
116+
key: "test-${{matrix.spec}}-${{steps.get-date.outputs.date}}"
117+
fail-on-cache-miss: true
110118
- name: pytest
111119
run: pytest --disable-pytest-warnings
112120
env:
@@ -116,7 +124,7 @@ jobs:
116124
uses: orgoro/[email protected]
117125
with:
118126
coverageFile: coverage.xml
119-
token: ${{ secrets.GITHUB_TOKEN }}
127+
token: ${{secrets.GITHUB_TOKEN}}
120128
- if: matrix.report-coverage && github.ref == 'refs/heads/main'
121129
run: |
122130
pip install genbadge[coverage]

0 commit comments

Comments
 (0)