Skip to content

Commit c529e08

Browse files
authored
repo sync
2 parents 748781f + fc79ca0 commit c529e08

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

content/actions/guides/building-and-testing-java-with-gradle.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,18 @@ steps:
105105
- name: Cache Gradle packages
106106
uses: actions/cache@v2
107107
with:
108-
path: ~/.gradle/caches
109-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
110-
restore-keys: ${{ runner.os }}-gradle
108+
path: |
109+
~/.gradle/caches
110+
~/.gradle/wrapper
111+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
112+
restore-keys: |
113+
${{ runner.os }}-gradle-
111114
- name: Build with Gradle
112115
run: ./gradlew build
113116
```
114117
{% endraw %}
115118

116-
This workflow will save the contents of your local Gradle package cache, located in the `.gradle/caches` directory of the runner's home directory. The cache key will be the hashed contents of the gradle build files, so changes to them will invalidate the cache.
119+
This workflow will save the contents of your local Gradle package cache, located in the `.gradle/caches` and `.gradle/wrapper` directories of the runner's home directory. The cache key will be the hashed contents of the gradle build files (including the Gradle wrapper properties file), so any changes to them will invalidate the cache.
117120

118121
### Packaging workflow data as artifacts
119122

0 commit comments

Comments
 (0)