From 273e62d17e230d761fe53699fcd2346aea436dcb Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Thu, 27 Aug 2026 17:45:01 -0500 Subject: [PATCH] ci: restore ci.yml's maven cache in the compat native build (#2636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup-graalvm's `cache: maven` keys on setup-graalvm-Linux-maven-, a key only this pull_request-only workflow ever writes. Actions caches are ref-scoped, so every write landed in refs/pull/N/merge where no other run could read it: build-native logged "maven cache is not found" on 6 of 6 sampled runs while dutifully saving 211 MB each time. That cost ~66s of cold dependency resolution — 1,398 "Downloading from" lines — inside an 8.6m job that serially gates all eight compat legs. ci.yml already saves ~/.m2/repository on every push to main under maven--. Restore that key here instead, read-only so ci.yml stays the single writer and the two never race. Expect most of the ~66s back rather than all of it: runner.os is Linux on both sides but ci.yml runs x64 while this runs arm64, so classifier-based native artifacts still re-download, and `-Dnative` pulls native-image plugins that ci.yml's `mvn test` never fetches. nightly.yml carries the same `cache: maven` and also misses, but for a different reason — it saves to a main-scoped key daily and is evicted by the repo's cache overrun rather than by ref-scoping. Left untouched; it should recover once that overrun is resolved. --- .github/workflows/compatibility.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index f07a8e7417..a0c3f15f01 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -92,9 +92,28 @@ jobs: with: java-version: '25' distribution: 'mandrel' - cache: maven + # no `cache: maven` — it keys on setup-graalvm-Linux-maven-, which + # only this pull_request-only workflow ever writes. Actions caches are + # ref-scoped, so those writes land in refs/pull/N/merge and no run can + # read another's: it logged "maven cache is not found" on 6 of 6 sampled + # runs while dutifully saving 211 MB each time. Restore ci.yml's cache + # below instead, which push-to-main genuinely populates. github-token: ${{ secrets.GITHUB_TOKEN }} + # Restore-only, and deliberately keyed identically to ci.yml:54-59 so this + # reads the ~/.m2 that ci.yml's shard 1 saves on every push to main. ci.yml + # stays the single owner of the save; a second writer would just race it. + # Two known partial-hit caveats, both cheap: `runner.os` is Linux for both + # but ci.yml runs x64 while this runs arm64 (Maven artifacts are + # arch-neutral, so only classifier-based natives re-download), and + # `-Dnative` pulls native-image plugins that ci.yml's `mvn test` never + # fetches. Expect most of the ~66s of cold resolution back, not all of it. + - uses: actions/cache/restore@v6.1.0 + with: + path: ~/.m2/repository + key: maven-${{ runner.os }}-${{ hashFiles('pom.xml') }} + restore-keys: maven-${{ runner.os }}- + - name: Build native executable (quick build) run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-Ob"