Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/actions/ci-incr-build-cache-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<!
beforeSettings {
caches {
releasedWrappers.setRemoveUnusedEntriesAfterDays(5)
snapshotWrappers.setRemoveUnusedEntriesAfterDays(1)
downloadedResources.setRemoveUnusedEntriesAfterDays(2)
createdResources.setRemoveUnusedEntriesAfterDays(5)
buildCache.setRemoveUnusedEntriesAfterDays(5)
}
}
!

- name: Prep env
shell: bash
run: |
Expand Down Expand Up @@ -71,12 +92,12 @@ runs:
if [[ -d ~/downloaded-artifacts/ ]] ; then
find ~/downloaded-artifacts/ -type f -name "ci-gradle-caches-*-${{ inputs.java-version }}.tar" | while read arch ; do
echo "Adding archive content from $arch ..."
(cd ~/.gradle/caches/ ; tar xf $arch)
(cd ~/.gradle/caches/ ; tar xf $arch --atime-preserve)
done
else
echo "No previous build cache artifacts downloaded."
fi

date +%s > ~/caches-prepared-at-epoch

echo "::endgroup::"
1 change: 0 additions & 1 deletion .github/actions/ci-incr-build-cache-save/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.