From 013bb46470f97285ae57190c9ce5201f31105a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Fri, 25 Oct 2024 12:27:06 +0200 Subject: [PATCH] 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. --- .github/workflows/ci-report.yml | 4 ++-- .github/workflows/ci.yml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-report.yml b/.github/workflows/ci-report.yml index 37ab5e27e8..e2ccf748a7 100644 --- a/.github/workflows/ci-report.yml +++ b/.github/workflows/ci-report.yml @@ -37,13 +37,13 @@ jobs: echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT - - name: Restore Maven/Gradle Local Caches + - name: Restore Maven/Gradle Dependency/Dist Caches uses: actions/cache/restore@v4 with: path: | ~/.m2/repository/ ~/.m2/wrapper/ - ~/.gradle/caches/ + ~/.gradle/caches/modules-2 ~/.gradle/wrapper/ key: ${{ steps.cache-key.outputs.buildtool-cache-key }} restore-keys: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972cd408e8..2d8bba2428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT - - name: Cache Maven/Gradle Local Caches + - name: Cache Maven/Gradle Dependency/Dist Caches id: cache-maven uses: actions/cache@v4 # if it's not a pull request, we restore and save the cache @@ -80,7 +80,7 @@ jobs: path: | ~/.m2/repository/ ~/.m2/wrapper/ - ~/.gradle/caches/ + ~/.gradle/caches/modules-2 ~/.gradle/wrapper/ # 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. # The whole cache is dropped monthly to prevent unlimited growth. @@ -89,7 +89,7 @@ jobs: restore-keys: | ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- - - name: Restore Maven/Gradle Local Caches + - name: Restore Maven/Gradle Dependency/Dist Caches uses: actions/cache/restore@v4 # if it a pull request, we restore the cache but we don't save it if: github.event_name == 'pull_request' @@ -97,7 +97,7 @@ jobs: path: | ~/.m2/repository/ ~/.m2/wrapper/ - ~/.gradle/caches/ + ~/.gradle/caches/modules-2 ~/.gradle/wrapper/ key: ${{ steps.cache-key.outputs.buildtool-cache-key }} restore-keys: | @@ -180,7 +180,7 @@ jobs: echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT - - name: Cache Maven/Gradle Local Caches + - name: Cache Maven/Gradle Dependency/Dist Caches id: cache-maven uses: actions/cache@v4 # if it's not a pull request, we restore and save the cache @@ -189,7 +189,7 @@ jobs: path: | ~/.m2/repository/ ~/.m2/wrapper/ - ~/.gradle/caches/ + ~/.gradle/caches/modules-2 ~/.gradle/wrapper/ # 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. # The whole cache is dropped monthly to prevent unlimited growth. @@ -198,7 +198,7 @@ jobs: restore-keys: | ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- - - name: Restore Maven/Gradle Local Caches + - name: Restore Maven/Gradle Dependency/Dist Caches uses: actions/cache/restore@v4 # if it a pull request, we restore the cache but we don't save it if: github.event_name == 'pull_request' @@ -206,7 +206,7 @@ jobs: path: | ~/.m2/repository/ ~/.m2/wrapper/ - ~/.gradle/caches/ + ~/.gradle/caches/modules-2 ~/.gradle/wrapper/ key: ${{ steps.cache-key.outputs.buildtool-cache-key }} restore-keys: |