diff --git a/.github/actions/ci-incr-build-cache-prepare/action.yml b/.github/actions/ci-incr-build-cache-prepare/action.yml index f09d4992eb..678dce27ca 100644 --- a/.github/actions/ci-incr-build-cache-prepare/action.yml +++ b/.github/actions/ci-incr-build-cache-prepare/action.yml @@ -32,6 +32,27 @@ inputs: runs: using: "composite" steps: + - name: Configure Gradle cache retention settings + # Without these settings, the Gradle Setup action will evict effectively all "restored incremental" entries, + # as it will remove all cache entries created before the start-time of the "Store Gradle Cache" job. + # The total size of GitHub caches for each repository is limited to 10GB, which means that we have to use + # more aggressive retention settings to keep the size of the Gradle cache stored in GitHub at an appropriate + # size. + shell: bash + run: | + mkdir -p ~/.gradle/init.d + cat > ~/.gradle/init.d/cache-settings.gradle.kts < ~/caches-prepared-at-epoch echo "::endgroup::" diff --git a/.github/actions/ci-incr-build-cache-save/action.yml b/.github/actions/ci-incr-build-cache-save/action.yml index 4d6085c971..728ff6c012 100644 --- a/.github/actions/ci-incr-build-cache-save/action.yml +++ b/.github/actions/ci-incr-build-cache-save/action.yml @@ -47,7 +47,6 @@ runs: -path './[0-9]*/kotlin-dsl/*' -or \ -path './jars-*/*' -or \ -path './modules-*/files-*/*' -or \ - -path './modules-*/files-*/*' -or \ -path './build-cache-*/*' \ ')' | grep -v '[.]lock$' > ~/ci-gradle-caches-diff || true echo "Identified $(wc -l < ~/ci-gradle-caches-diff) changed/added files in caches/" diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ddd44140ae..153d3ce0f3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -160,9 +160,6 @@ jobs: uses: ./.github/actions/ci-incr-build-cache-prepare with: cache-read-only: false - - name: Trigger Gradle home cleanup - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - run: ./gradlew --no-daemon :showVersion - # Note: the "Post Gradle invocation" archives the updated build cache. + # Note: the "Post Collect partial Gradle build caches"-step cleans up stale cache entries + # and archives the updated build cache.