From a68bfc4e68d265ebf34011b67ae83e0b65e489d5 Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Sun, 23 Aug 2026 23:37:07 -0400 Subject: [PATCH] fix(ci): replace setup-java's broken maven cache with actions/cache (#2503) * fix(ci): replace setup-java's broken maven cache with actions/cache setup-java@v5.6.0's built-in cache: maven has never worked on this repo: every run restores nothing ("maven cache is not found") and then fails to save ("Path Validation Error: Path(s) specified in the action for caching do(es) not exist"), so every single CI run resolves the full dependency tree cold. Confirmed across 3 independent runs, no custom localRepository override anywhere that would explain it - looks like a bug in this pinned action version. Uses actions/cache directly instead, keyed on pom.xml's hash - the same underlying mechanism setup-java's option wraps, just debuggable and not broken. Free (GitHub Actions cache storage is free up to 10GB/repo), same runner, no test/build logic touched. * fix(ci): scope the maven cache key to the root pom.xml only hashFiles('**/pom.xml') also picked up compatibility-tests/sdk-test-java/pom.xml, a separate project this workflow never builds - its own paths: trigger only watches the root pom.xml. An unrelated change there would bust the cache key and cost this fix its whole point on the next run. --- .github/workflows/ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6195c788a4..349f81285e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,18 @@ jobs: with: java-version: '25' distribution: 'temurin' - cache: maven + + # setup-java's built-in `cache: maven` never actually saves a cache on this action + # version - every run restores nothing ("maven cache is not found") and then fails to + # save with "Path Validation Error: Path(s) specified in the action for caching do(es) + # not exist", so every run has been resolving all dependencies cold. Using actions/cache + # directly instead, which is the same mechanism setup-java's option wraps. + - uses: actions/cache@v6.1.0 + with: + path: ~/.m2/repository + key: maven-${{ runner.os }}-${{ hashFiles('pom.xml') }} + restore-keys: | + maven-${{ runner.os }}- - name: Run tests run: mvn test -B