Skip to content

Commit 254cdc6

Browse files
authored
Merge pull request #7 from aboutbits/add-gradle-configuration-cache-encryption-key
Add Gradle configuration cache encryption secret `GRADLE_ENCRYPTION_KEY`
2 parents 4a300cd + 9039b7d commit 254cdc6

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ The following outputs are forwarded from the underlying `setup-java` and `cache`
7979
| `path` | Path to where the java environment has been installed (same as $JAVA_HOME). |
8080
| `cache-hit` | A boolean value to indicate an exact match was found for the primary key. (Not applicable when Gradle is used) |
8181

82+
## Gradle configuration cache
83+
84+
To enable the Gradle configuration cache, which further improves the build performance in addition to the default enabled wrapper/script/dependency/build cache, a GitHub secret called `GRADLE_ENCRYPTION_KEY` must exist.
85+
If the secret does not exist, Gradle will still work, but the configuration cache will not be saved.
86+
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#saving-configuration-cache-data
87+
8288
## Versioning
8389

8490
In order to have a versioning in place and working, create lightweight tags that point to the appropriate minor release

setup-and-install-with-gradle/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ runs:
4040
uses: gradle/actions/setup-gradle@v4
4141
with:
4242
cache-disabled: ${{ inputs.cache == 'false' }}
43+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4344
cache-read-only: 'false'
4445

4546
- name: Update dependencies

setup-with-gradle/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ runs:
4040
uses: gradle/actions/setup-gradle@v4
4141
with:
4242
cache-disabled: ${{ inputs.cache == 'false' }}
43+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4344
cache-read-only: 'false'

0 commit comments

Comments
 (0)