Skip to content

Commit 9739428

Browse files
yrodierebeikov
authored andcommitted
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. (cherry picked from commit 013bb46)
1 parent bd209ce commit 9739428

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
@@ -72,7 +72,7 @@ jobs:
7272
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
7373
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
7474
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
75-
- name: Cache Maven/Gradle Local Caches
75+
- name: Cache Maven/Gradle Dependency/Dist Caches
7676
id: cache-maven
7777
uses: actions/cache@v4
7878
# if it's not a pull request, we restore and save the cache
@@ -81,7 +81,7 @@ jobs:
8181
path: |
8282
~/.m2/repository/
8383
~/.m2/wrapper/
84-
~/.gradle/caches/
84+
~/.gradle/caches/modules-2
8585
~/.gradle/wrapper/
8686
# 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.
8787
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -90,15 +90,15 @@ jobs:
9090
restore-keys: |
9191
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
9292
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
93-
- name: Restore Maven/Gradle Local Caches
93+
- name: Restore Maven/Gradle Dependency/Dist Caches
9494
uses: actions/cache/restore@v4
9595
# if it a pull request, we restore the cache but we don't save it
9696
if: github.event_name == 'pull_request'
9797
with:
9898
path: |
9999
~/.m2/repository/
100100
~/.m2/wrapper/
101-
~/.gradle/caches/
101+
~/.gradle/caches/modules-2
102102
~/.gradle/wrapper/
103103
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
104104
restore-keys: |
@@ -181,7 +181,7 @@ jobs:
181181
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
182182
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
183183
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
184-
- name: Cache Maven/Gradle Local Caches
184+
- name: Cache Maven/Gradle Dependency/Dist Caches
185185
id: cache-maven
186186
uses: actions/cache@v4
187187
# if it's not a pull request, we restore and save the cache
@@ -190,7 +190,7 @@ jobs:
190190
path: |
191191
~/.m2/repository/
192192
~/.m2/wrapper/
193-
~/.gradle/caches/
193+
~/.gradle/caches/modules-2
194194
~/.gradle/wrapper/
195195
# 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.
196196
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -199,15 +199,15 @@ jobs:
199199
restore-keys: |
200200
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
201201
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
202-
- name: Restore Maven/Gradle Local Caches
202+
- name: Restore Maven/Gradle Dependency/Dist Caches
203203
uses: actions/cache/restore@v4
204204
# if it a pull request, we restore the cache but we don't save it
205205
if: github.event_name == 'pull_request'
206206
with:
207207
path: |
208208
~/.m2/repository/
209209
~/.m2/wrapper/
210-
~/.gradle/caches/
210+
~/.gradle/caches/modules-2
211211
~/.gradle/wrapper/
212212
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
213213
restore-keys: |

0 commit comments

Comments
 (0)