-
Notifications
You must be signed in to change notification settings - Fork 38
Enable Gradle cache in build.yml and windows-build.yml workflows using gradle/actions/setup-gradle #702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
|
@copilot |
The create-release.yml workflow also uses Gradle for publishing packages but was missing the gradle-build-action caching configuration. This adds the proper setup step with gradle-version: wrapper to enable caching for the publish job as well. Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
You're absolutely right! I missed the create-release.yml workflow which also uses Gradle for publishing packages. I've now updated it to include the gradle/gradle-build-action@v3 with proper caching configuration as well. The change ensures all workflows that use the libcobj/ Gradle project now benefit from Gradle caching. See commit 77527af. |
|
@copilot |
…up-gradle Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
You're absolutely right! I've updated all five workflows to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables Gradle caching in GitHub Actions workflows to improve build performance by adding the gradle/actions/setup-gradle@v3 action to five workflows that use Gradle. This will cache Gradle dependencies, wrapper, and build cache between workflow runs.
- Added Gradle setup step with caching to five GitHub Actions workflows
- Replaced deprecated
gradle/gradle-build-actionwith the recommended approach - Configured to use project's Gradle wrapper version for consistency
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/windows-build.yml | Added Gradle setup for shadowJar build caching |
| .github/workflows/update-github-pages.yml | Added Gradle setup for Javadoc generation caching |
| .github/workflows/static-analysis.yml | Added Gradle setup for SpotBugs and PMD task caching |
| .github/workflows/javadoc.yml | Added Gradle setup for Javadoc generation caching |
| .github/workflows/create-release.yml | Replaced deprecated gradle-build-action with setup-gradle and direct command execution |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
gradleのキャッシュによる高速化は.github/workflows/build.ymlと.github/workflows/windows-build.yml に対してのみ適用するように変更して |
Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
I've updated the workflows to limit Gradle caching to only windows-build.yml as requested. The gradle/actions/setup-gradle has been removed from static-analysis.yml, javadoc.yml, update-github-pages.yml, and create-release.yml. Note: build.yml was not modified since it doesn't currently use any Gradle commands. Only windows-build.yml now has Gradle caching enabled. See commit 8647778. |
|
@copilot |
Co-authored-by: yutaro-sakamoto <80912876+yutaro-sakamoto@users.noreply.github.com>
You're absolutely right! I've added Gradle caching to build.yml since the make command implicitly calls |
This PR enables Gradle caching in both build.yml and windows-build.yml GitHub Actions workflows to improve build performance for Java components built with Gradle.
Problem
Previously, Gradle dependencies and build cache were not being cached between workflow runs in either workflow, causing slower build times and unnecessary network usage. The build.yml workflow was particularly affected because its
makecommand implicitly calls./gradlew shadowJarin the libcobj directory, but without any caching optimization.Solution
Added the
gradle/actions/setup-gradle@v3step to both workflows:./gradlew shadowJarcommand./gradlew shadowJarcalled by themakecommandBoth actions are configured with
gradle-version: wrapperto respect the project's Gradle wrapper configuration (currently Gradle 8.2.1).Benefits
gradle/actions/setup-gradleaction instead of the deprecatedgradle/gradle-build-actionTechnical Details
The
gradle/actions/setup-gradleaction automatically handles caching of:The build.yml workflow benefits from this caching because when it runs
make, the libcobj/Makefile.am executes./gradlew shadowJarto build the Java library components.Fixes #396.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.