Skip to content

Commit e6cfdb4

Browse files
authored
Adjust CI cache key names to be consistent (#105)
This adjusts the cache keys used in the CI setup based on the improved version from #104. I think there were some typos (e.g. using `pants-setup-...` for the `named_caches` restore key), and it seems that scoping everything under `pants-{name}-...` is nifty.
1 parent 9052b68 commit e6cfdb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/pants.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ jobs:
4545
~/.cache/pants/named_caches
4646
# The Python backend uses named_caches for Pip/PEX state,
4747
# so it is appropriate to invalidate on requirements.txt changes.
48-
key: named-caches-${{ runner.os }}-${{ hashFiles('pants.toml') }}-${{ hashFiles('requirements.txt') }}
48+
key: pants-named-caches-${{ runner.os }}-${{ hashFiles('pants.toml') }}-${{ hashFiles('requirements.txt') }}
4949
# Note that falling back to a restore key may give a useful partial result that will save time
5050
# over completely clean state, but will cause the cache entry to grow without bound over time.
5151
# See https://pants.readme.io/docs/using-pants-in-ci for tips on how to periodically clean it up.
5252
# Alternatively you may want to avoid using restore keys.
5353
restore-keys: |
54-
pants-setup-${{ runner.os }}-${{ hashFiles('pants.toml') }}-${{ hashFiles('requirements.txt') }}
55-
pants-setup-${{ runner.os }}-${{ hashFiles('pants.toml') }}-
56-
pants-setup-${{ runner.os }}-
54+
pants-named-caches-${{ runner.os }}-${{ hashFiles('pants.toml') }}-${{ hashFiles('requirements.txt') }}
55+
pants-named-caches-${{ runner.os }}-${{ hashFiles('pants.toml') }}-
56+
pants-named-caches-${{ runner.os }}-
5757
# If you're not using a fine-grained remote caching service (see https://www.pantsbuild.org/docs/remote-caching),
5858
# then you may also want to preserve the local Pants cache (lmdb_store). However this must invalidate for
5959
# changes to any file that can affect the build, so may not be practical in larger repos.
@@ -63,9 +63,9 @@ jobs:
6363
with:
6464
path: |
6565
~/.cache/pants/lmdb_store
66-
key: pants-setup-${{ runner.os }}-${{ hashFiles('**/*') }}
66+
key: pants-lmdb-store-${{ runner.os }}-${{ hashFiles('**/*') }}
6767
# Same caveat as above regarding the issues with restore keys.
68-
restore-keys: pants-setup-${{ runner.os }}-
68+
restore-keys: pants-lmdb-store-${{ runner.os }}-
6969
- name: Setup Python ${{ matrix.python-version }}
7070
uses: actions/setup-python@v1
7171
with:

0 commit comments

Comments
 (0)