Skip to content

Cache unpacked Gradle wrapper distributions in GitHub Actions workflows#308

Merged
ggrell merged 3 commits intomainfrom
codex/ensure-gradle-binaries-are-cached
Mar 1, 2026
Merged

Cache unpacked Gradle wrapper distributions in GitHub Actions workflows#308
ggrell merged 3 commits intomainfrom
codex/ensure-gradle-binaries-are-cached

Conversation

@ggrell
Copy link
Owner

@ggrell ggrell commented Mar 1, 2026

Motivation

  • CI runs were repeatedly downloading and decompressing the Gradle wrapper ZIPs because the unpacked wrapper distribution folder is not reliably preserved by actions/setup-java's cache: 'gradle' alone.
  • Persisting the unpacked Gradle binaries across runs reduces download/decompress overhead and speeds builds for PR, main (snapshot), and release workflows.

Description

  • Added an actions/cache@v4 step to pull_request, merge_master, and publish_release workflows to cache ~/.gradle/wrapper/dists so the unpacked Gradle distributions are restored between runs.
  • The cache is keyed by ${{ runner.os }}-gradle-wrapper-dists-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} with an OS-level restore key fallback.
  • Left actions/setup-java with cache: 'gradle' enabled so dependency/module caching and the new wrapper-distribution cache work together.
  • Modified files: .github/workflows/pull_request.yml, .github/workflows/merge_master.yml, and .github/workflows/publish_release.yml.

Testing

  • Parsed each updated workflow YAML with ruby -e "require 'yaml'; %w[.github/workflows/pull_request.yml .github/workflows/merge_master.yml .github/workflows/publish_release.yml].each{|f| YAML.load_file(f); puts \"OK #{f}\" }" and the parser reported success for all three files.
  • Verified the workflow diffs with git diff to confirm the intended cache steps were added successfully.

Codex Task

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.11%. Comparing base (cfc13bc) to head (a58a535).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #308   +/-   ##
=========================================
  Coverage     88.11%   88.11%           
  Complexity       48       48           
=========================================
  Files             9        9           
  Lines           101      101           
=========================================
  Hits             89       89           
  Misses           12       12           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0471d5d...a58a535. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ggrell ggrell merged commit 3fd6695 into main Mar 1, 2026
5 checks passed
@ggrell ggrell deleted the codex/ensure-gradle-binaries-are-cached branch March 1, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant