Skip to content

ci: optimize GHA caching in ci.yaml using prime-maven-cache composite action - #13954

Closed
lqiu96 wants to merge 1 commit into
mainfrom
optimize-ci-caching
Closed

ci: optimize GHA caching in ci.yaml using prime-maven-cache composite action#13954
lqiu96 wants to merge 1 commit into
mainfrom
optimize-ci-caching

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jul 30, 2026

Copy link
Copy Markdown
Member

[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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are two improvements needed here:

  1. 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 25 may cause setup failures or use unstable early-access builds.
  2. Documentation Clarification: In accordance with the project's general rules, we should clarify in the documentation that mvn install is used for building snapshot artifacts to the local ~/.m2 repository.
    # 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
  1. In documentation about the Java build process, clarify that mvn install is used for building snapshot artifacts to the local ~/.m2 repository.

@lqiu96
lqiu96 force-pushed the optimize-ci-caching branch from e3a5534 to dee34eb Compare July 30, 2026 02:18
@lqiu96 lqiu96 closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant