Skip to content

Commit 013bb46

Browse files
committed
Do not include the whole Gradle cache in GH Actions caches
We don't need the whole cache, since most (all?) of it is stored on Develocity already. Including ./gradle/caches/modules-2 is enough, because that's where Maven dependencies are stored, and *those* are not stored on Develocity.
1 parent 62fe772 commit 013bb46

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/ci-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
3838
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
3939
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
40-
- name: Restore Maven/Gradle Local Caches
40+
- name: Restore Maven/Gradle Dependency/Dist Caches
4141
uses: actions/cache/restore@v4
4242
with:
4343
path: |
4444
~/.m2/repository/
4545
~/.m2/wrapper/
46-
~/.gradle/caches/
46+
~/.gradle/caches/modules-2
4747
~/.gradle/wrapper/
4848
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
4949
restore-keys: |

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
7272
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
7373
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
74-
- name: Cache Maven/Gradle Local Caches
74+
- name: Cache Maven/Gradle Dependency/Dist Caches
7575
id: cache-maven
7676
uses: actions/cache@v4
7777
# if it's not a pull request, we restore and save the cache
@@ -80,7 +80,7 @@ jobs:
8080
path: |
8181
~/.m2/repository/
8282
~/.m2/wrapper/
83-
~/.gradle/caches/
83+
~/.gradle/caches/modules-2
8484
~/.gradle/wrapper/
8585
# A new cache will be stored daily. After that first store of the day, cache save actions will fail because the cache is immutable but it's not a problem.
8686
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -89,15 +89,15 @@ jobs:
8989
restore-keys: |
9090
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
9191
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
92-
- name: Restore Maven/Gradle Local Caches
92+
- name: Restore Maven/Gradle Dependency/Dist Caches
9393
uses: actions/cache/restore@v4
9494
# if it a pull request, we restore the cache but we don't save it
9595
if: github.event_name == 'pull_request'
9696
with:
9797
path: |
9898
~/.m2/repository/
9999
~/.m2/wrapper/
100-
~/.gradle/caches/
100+
~/.gradle/caches/modules-2
101101
~/.gradle/wrapper/
102102
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
103103
restore-keys: |
@@ -180,7 +180,7 @@ jobs:
180180
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
181181
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
182182
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
183-
- name: Cache Maven/Gradle Local Caches
183+
- name: Cache Maven/Gradle Dependency/Dist Caches
184184
id: cache-maven
185185
uses: actions/cache@v4
186186
# if it's not a pull request, we restore and save the cache
@@ -189,7 +189,7 @@ jobs:
189189
path: |
190190
~/.m2/repository/
191191
~/.m2/wrapper/
192-
~/.gradle/caches/
192+
~/.gradle/caches/modules-2
193193
~/.gradle/wrapper/
194194
# A new cache will be stored daily. After that first store of the day, cache save actions will fail because the cache is immutable but it's not a problem.
195195
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -198,15 +198,15 @@ jobs:
198198
restore-keys: |
199199
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
200200
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
201-
- name: Restore Maven/Gradle Local Caches
201+
- name: Restore Maven/Gradle Dependency/Dist Caches
202202
uses: actions/cache/restore@v4
203203
# if it a pull request, we restore the cache but we don't save it
204204
if: github.event_name == 'pull_request'
205205
with:
206206
path: |
207207
~/.m2/repository/
208208
~/.m2/wrapper/
209-
~/.gradle/caches/
209+
~/.gradle/caches/modules-2
210210
~/.gradle/wrapper/
211211
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
212212
restore-keys: |

0 commit comments

Comments
 (0)