Test setup-java PR #1097: wrapper cache separation#5
Open
brunoborges wants to merge 1 commit into
Open
Conversation
Adds a Maven wrapper project (.mvn/wrapper/maven-wrapper.properties + mvnw) and a workflow pinned to actions/setup-java#1097 (SHA 6cd4d86) that proves wrapper distributions are cached separately from the dependency cache. Each build tool has a prime job (populates caches) and a verify job that rotates the main dependency cache key (edits pom.xml / build.gradle) so the dependency cache MISSES while the wrapper cache still HITS, asserting the wrapper distribution is restored despite the miss (fixes #1095). A final job lists the repo caches and asserts distinct *-maven-wrapper-* / *-gradle-wrapper-* entries exist. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a workflow to test actions/setup-java#1097 — "Cache Maven and Gradle wrapper distributions separately from the dependency cache" (fixes actions/setup-java#1095).
Pinned to the PR head commit
6cd4d8602abcb93d479ac1a322ebf80166d853e6.What it verifies
The PR moves each build tool's wrapper distribution into its own cache entry keyed only on the wrapper properties file, so it survives the frequent dependency changes that rotate (and miss) the main dependency cache.
.github/workflows/wrapper-cache.ymlproves this deterministically in a single run:maven-prime/gradle-prime— run./mvnw/./gradlew, downloading the wrapper distribution; setup-java's post step saves both the main dependency cache and the separatemaven-wrapper/gradle-wrappercaches.maven-verify/gradle-verify— on a fresh runner, first rotate the main dependency cache key by editingpom.xml/build.gradle(without touching the wrapper properties), then run setup-java. The main dependency cache MISSES (cache-hit == false) but the wrapper distribution is still restored from its independent cache. The job asserts the wrapper dist is on disk before building — exactly the #1095 scenario the PR fixes.verify-cache-entries— lists the repo's Actions caches and asserts distinct*-maven-wrapper-*and*-gradle-wrapper-*entries exist alongside the mainmaven/gradledependency caches (separation, not replacement).New fixtures
maven-wrapper-project/— a Maven project with a realonly-scriptwrapper (.mvn/wrapper/maven-wrapper.properties→ Maven 3.9.14), needed because no existing project had a Maven wrapper. The Gradle side reuses the existingjavac-matcher-gradlewrapper.