ADFA-4306 Constrain GitHub Actions cache growth in analyze.yml#1384
Conversation
The daily Jacoco/SonarQube job's Linux-gradle cache had grown to ~26 GB
on stage (vs. GitHub's 10 GB limit. Three changes scope it back:
- Cache only ~/.gradle/caches/{modules-2,jars-*,transforms-*} and
~/.gradle/wrapper, excluding ~/.gradle/caches/build-cache-1 (Gradle's
task-output build cache). Add gradle-wrapper.properties to hashFiles
so a wrapper bump invalidates the key.
- Branch-scope and content-hash the SonarQube cache key so it rolls
over under GitHub's 7-day LRU instead of pinning forever.
- Pass --no-build-cache to the sonarqube invocation so the build cache
stays empty even if the directory reappears.
- Set retention-days: 7 on the JaCoCo report artifact (was the 90-day
default).
EOF
)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughChanges to GitHub Actions Analyze WorkflowCache & Artifact Optimizations
Risks & Best Practices Considerations
WalkthroughThe ChangesCI Cache and Artifact Tuning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The daily Jacoco/SonarQube job's Linux-gradle cache had grown to ~26 GB
on stage (vs. GitHub's 10 GB limit. Three changes scope it back:
- Cache only ~/.gradle/caches/{modules-2,jars-*,transforms-*} and
~/.gradle/wrapper, excluding ~/.gradle/caches/build-cache-1 (Gradle's
task-output build cache). Add gradle-wrapper.properties to hashFiles
so a wrapper bump invalidates the key.
- Branch-scope and content-hash the SonarQube cache key so it rolls
over under GitHub's 7-day LRU instead of pinning forever.
- Pass --no-build-cache to the sonarqube invocation so the build cache
stays empty even if the directory reappears.
- Set retention-days: 7 on the JaCoCo report artifact (was the 90-day
default).
EOF
)
Summary
Linux-gradlecache onstagehad grown to ~26 GB (vs. GitHub's 10 GB limit), evicting useful caches across the repo.~/.gradle/caches/build-cache-1(Gradle's task-output build cache — the actual driver of the bloat). Addsgradle-wrapper.propertiesto thehashFiles()key.stage.--no-build-cacheto thesonarqubeinvocation so the build cache stays empty even if the directory reappears.retention-days: 7on the JaCoCo report artifact (was the 90-day default).Test plan
analyze.ymlmanually viaworkflow_dispatchon this branch.Linux-gradle-<hash>entry in Actions → Caches is < 2 GB.Linux-sonar-<branch>-<hash>entry is < 500 MB.Cache restored successfully.stageruns, confirm total cache usage stays well under 10 GB.