Skip to content

Commit c1e6627

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 b707b02 commit c1e6627

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/atlas.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
6565
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
6666
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
67-
- name: Cache Maven/Gradle Local Caches
67+
- name: Cache Maven/Gradle Dependency/Dist Caches
6868
id: cache-maven
6969
uses: actions/cache@v4
7070
# if it's not a pull request, we restore and save the cache
@@ -73,7 +73,7 @@ jobs:
7373
path: |
7474
~/.m2/repository/
7575
~/.m2/wrapper/
76-
~/.gradle/caches/
76+
~/.gradle/caches/modules-2
7777
~/.gradle/wrapper/
7878
# 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.
7979
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -82,15 +82,15 @@ jobs:
8282
restore-keys: |
8383
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
8484
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
85-
- name: Restore Maven/Gradle Local Caches
85+
- name: Restore Maven/Gradle Dependency/Dist Caches
8686
uses: actions/cache/restore@v3
8787
# if it a pull request, we restore the cache but we don't save it
8888
if: github.event_name == 'pull_request'
8989
with:
9090
path: |
9191
~/.m2/repository/
9292
~/.m2/wrapper/
93-
~/.gradle/caches/
93+
~/.gradle/caches/modules-2
9494
~/.gradle/wrapper/
9595
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
9696
restore-keys: |

.github/workflows/contributor-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT
7474
echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT
7575
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
76-
- name: Cache Maven/Gradle Local Caches
76+
- name: Cache Maven/Gradle Dependency/Dist Caches
7777
id: cache-maven
7878
uses: actions/cache@v4
7979
# if it's not a pull request, we restore and save the cache
@@ -82,7 +82,7 @@ jobs:
8282
path: |
8383
~/.m2/repository/
8484
~/.m2/wrapper/
85-
~/.gradle/caches/
85+
~/.gradle/caches/modules-2
8686
~/.gradle/wrapper/
8787
# 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.
8888
# The whole cache is dropped monthly to prevent unlimited growth.
@@ -91,15 +91,15 @@ jobs:
9191
restore-keys: |
9292
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
9393
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
94-
- name: Restore Maven/Gradle Local Caches
94+
- name: Restore Maven/Gradle Dependency/Dist Caches
9595
uses: actions/cache/restore@v3
9696
# if it a pull request, we restore the cache but we don't save it
9797
if: github.event_name == 'pull_request'
9898
with:
9999
path: |
100100
~/.m2/repository/
101101
~/.m2/wrapper/
102-
~/.gradle/caches/
102+
~/.gradle/caches/modules-2
103103
~/.gradle/wrapper/
104104
key: ${{ steps.cache-key.outputs.buildtool-cache-key }}
105105
restore-keys: |

0 commit comments

Comments
 (0)