ci: optimize GHA caching in ci.yaml using prime-maven-cache composite action - #13954
Closed
lqiu96 wants to merge 1 commit into
Closed
ci: optimize GHA caching in ci.yaml using prime-maven-cache composite action#13954lqiu96 wants to merge 1 commit into
lqiu96 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new GitHub Actions composite action to prime the Maven cache by downloading dependencies during a pre-population step. The review feedback suggests updating the Java version from 25 to 21, as Java 25 is not yet a released LTS version, and refining the documentation to clarify that 'mvn install' is used for building snapshot artifacts to the local repository.
Comment on lines
+9
to
+17
| # We default to the latest LTS version (25) to run the pre-population step. | ||
| # Furthermore, GitHub Actions Cache entries are immutable by primary key: downstream jobs | ||
| # restoring this cache can run 'mvn install' or add SNAPSHOT JARs locally without ever | ||
| # polluting or overwriting the remote cache. | ||
| - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | ||
| with: | ||
| java-version: 25 | ||
| distribution: 'temurin' | ||
| cache: 'maven' |
Contributor
There was a problem hiding this comment.
There are two improvements needed here:
- Java Version: The latest LTS version of Java is currently 21. Java 25 is not yet released as a General Availability (GA) LTS version, so specifying
25may cause setup failures or use unstable early-access builds. - Documentation Clarification: In accordance with the project's general rules, we should clarify in the documentation that
mvn installis used for building snapshot artifacts to the local~/.m2repository.
# We default to the latest LTS version (21) to run the pre-population step.
# Furthermore, GitHub Actions Cache entries are immutable by primary key: downstream jobs
# restoring this cache can run 'mvn install' (which is used for building snapshot artifacts
# to the local ~/.m2 repository) or add SNAPSHOT JARs locally without ever
# polluting or overwriting the remote cache.
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'References
- In documentation about the Java build process, clarify that
mvn installis used for building snapshot artifacts to the local~/.m2repository.
lqiu96
force-pushed
the
optimize-ci-caching
branch
from
July 30, 2026 02:18
e3a5534 to
dee34eb
Compare
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.
[DRAFT] - No need to review for now
Just an idea inspired from the zizmor workflow to have pre-reqs. Re-use the cache to try and speed up the setup time.
Part of #13296