Skip to content

Commit 659c395

Browse files
committed
save env cache earlier
1 parent 6582ca0 commit 659c395

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
echo "today=$(date -u '+%Y%m%d')"
125125
echo "today=$(date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
126126
- name: Cache env
127-
uses: actions/cache@v4
127+
uses: actions/cache/restore@v4
128128
with:
129129
path: ${{env.CONDA}}/envs/${{steps.setup.outputs.env-name}}
130130
key: >-
@@ -138,6 +138,18 @@ jobs:
138138
- name: Update env
139139
run: conda env update --name=${{steps.setup.outputs.env-name}} --file=${{steps.setup.outputs.env-file}} python=${{matrix.python-version}}
140140
if: steps.cache-env.outputs.cache-hit != 'true'
141+
- name: Update cached env
142+
if: steps.cache-env.outputs.cache-hit != 'true'
143+
uses: actions/cache/save@v4
144+
with:
145+
path: ${{env.CONDA}}/envs/${{steps.setup.outputs.env-name}}
146+
key: >-
147+
conda-${{runner.os}}-${{runner.arch}}
148+
-${{steps.get-date.outputs.today}}
149+
-${{hashFiles(steps.setup.outputs.env-file)}}
150+
-${{env.CACHE_NUMBER}}
151+
env:
152+
CACHE_NUMBER: 0
141153
- run: |
142154
pyright --version
143155
pyright -p pyproject.toml --pythonversion ${{ matrix.python-version }}

0 commit comments

Comments
 (0)