Clarify that tags are isolated in cache entries
Some checks failed
CI-check-and-unit-test / check-format-and-unit-test (push) Has been cancelled
CI-codeql / Analyze (javascript-typescript) (push) Has been cancelled
CI-init-script-check / test-init-scripts (push) Has been cancelled
CI-update-dist / update-dist (push) Has been cancelled
CI-integ-test / determine-suite (push) Has been cancelled
CI-integ-test / dependency-submission-failures (push) Has been cancelled
CI-integ-test / execution-with-caching (push) Has been cancelled
CI-integ-test / execution (push) Has been cancelled
CI-integ-test / develocity-injection (push) Has been cancelled
CI-integ-test / provision-gradle-versions (push) Has been cancelled
CI-integ-test / restore-configuration-cache (push) Has been cancelled
CI-integ-test / restore-containerized-gradle-home (push) Has been cancelled
CI-integ-test / restore-custom-gradle-home (push) Has been cancelled
CI-integ-test / restore-gradle-home (push) Has been cancelled
CI-integ-test / restore-java-toolchain (push) Has been cancelled
CI-integ-test / sample-kotlin-dsl (push) Has been cancelled
CI-integ-test / sample-gradle-plugin (push) Has been cancelled
CI-integ-test / toolchain-detection (push) Has been cancelled
CI-integ-test / wrapper-validation (push) Has been cancelled
CI-integ-test / build-distribution (push) Has been cancelled
CI-integ-test / action-inputs (push) Has been cancelled
CI-integ-test / build-scan-publish (push) Has been cancelled
CI-integ-test / cache-cleanup (push) Has been cancelled
CI-integ-test / caching-config (push) Has been cancelled
CI-integ-test / dependency-graph (push) Has been cancelled
CI-integ-test / dependency-submission (push) Has been cancelled

This commit is contained in:
Daz DeBoer 2024-07-02 12:15:24 -06:00 committed by GitHub
parent cdbbabd09c
commit 81b4ece56a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -218,7 +218,7 @@ Using either of these mechanisms may interfere with the caching provided by this
The GitHub Actions cache has some properties that present problems for efficient caching of the Gradle User Home.
- Immutable entries: once a cache entry is written for a key, it cannot be overwritten or changed.
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches or tags. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
- Restore keys: if no exact match is found, a set of partial keys can be provided that will match by cache key prefix. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
Each of these properties has influenced the design and implementation of the caching in `setup-gradle`, as described below.
@ -316,8 +316,8 @@ Some techniques can be used to avoid/mitigate this issue:
### Select which branches should write to the cache
GitHub cache entries are not shared between builds on different branches.
Workflow runs can restore caches created in either the current branch or the default branch (usually main).
GitHub cache entries are not shared between builds on different branches or tags.
Workflow runs can _only_ restore caches created in either the same branch or the default branch (usually `main`).
This means that each branch will have its own Gradle User Home cache scope, and will not benefit from cache entries written for other (non-default) branches.
By default, The `setup-gradle` action will only _write_ to the cache for builds run on the default (`master`/`main`) branch.