Skip to content

Commit 7561195

Browse files
committed
Improved benchmark GHA env caching (2min faster?)
1 parent 0a806f1 commit 7561195

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/benchmark.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
1717
IRIS_TEST_DATA_VERSION: "2.5"
1818
# Lets us manually bump the cache to rebuild
19+
ENV_CACHE_BUILD: "0"
1920
TEST_DATA_CACHE_BUILD: "2"
2021
PY_VER: 3.8
2122

@@ -33,19 +34,15 @@ jobs:
3334
run: |
3435
pip install nox
3536
36-
- name: Cache .nox and .asv/env directories
37+
- name: Cache environment directories
3738
id: cache-env-dir
3839
uses: actions/cache@v2
3940
with:
4041
path: |
4142
.nox
4243
benchmarks/.asv/env
43-
# Make sure GHA never gets an exact cache match by using the unique
44-
# github.sha. This means it will always store this run as a new
45-
# cache (Nox may have made relevant changes during run). Cache
46-
# restoration still succeeds via the partial restore-key match.
47-
key: ${{ runner.os }}-${{ github.sha }}
48-
restore-keys: ${{ runner.os }}
44+
$CONDA/pkgs
45+
key: ${{ runner.os }}-${{ hashFiles('requirements/') }}-${{ env.ENV_CACHE_BUILD }}
4946

5047
- name: Cache test data directory
5148
id: cache-test-data

0 commit comments

Comments
 (0)