From eb794cefbd46058cb8e5dba2a9337082ffaf641f Mon Sep 17 00:00:00 2001 From: screentinker Date: Thu, 23 Jul 2026 22:24:21 -0500 Subject: [PATCH] ci(android): cache Gradle to stop wrapper-download flakes (#226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The android-test job ran ./gradlew with no Gradle caching, so every run re-downloaded the full Gradle distribution (gradle-8.5-bin.zip, ~130MB) from services.gradle.org. A transient "Connection reset" mid-download failed the job before any test ran (stack bottomed out in org.gradle.wrapper.Install.forceFetch) — e.g. run 30063222009 on the npm-audit-fix PR, which passed on a plain re-run. Add `cache: gradle` to the existing setup-java step. It caches ~/.gradle/caches and ~/.gradle/wrapper; the wrapper cache holds the distribution zip, so cache-hit runs skip the download entirely — removing the network dependency that flaked. Also speeds the job up (build cache reuse). Residual: a cold cache (first run per key, or a gradle-wrapper.properties change) still downloads once. If that proves flaky too, a download retry can be layered on, but caching turns "download every run" into "download rarely". Co-authored-by: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8da1254..7458ece 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,12 @@ jobs: with: distribution: temurin java-version: '17' + # Cache ~/.gradle/caches AND ~/.gradle/wrapper. The wrapper cache holds the + # Gradle distribution (gradle-8.5-bin.zip); without it every run re-downloaded + # ~130MB from services.gradle.org, and a transient reset there failed the job + # before any test ran (org.gradle.wrapper.Install.forceFetch). On a cache hit the + # distribution is already present, so the download — and its flake — is skipped. + cache: gradle - uses: android-actions/setup-android@v3 # ScheduleEvalTest reads the SHARED shared/schedule-vectors.json (wired via # the test task in app/build.gradle.kts), so a ScheduleEval.kt change that