Cache Gradle wrapper and other Gradle caches between workflow executions
See original GitHub issueGithub Actions agents are ephemeral, Gradle builds need to download the Gradle distribution, generate API jars, download dependencies etc… All this could be avoided on repeated builds by caching the relevant Gradle caches.
One can use https://github.com/marketplace/actions/cache Today but it requires some boilerplate:
- uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
This issue is about reusing actions/cache
mechanism from this very action to reduce that boilerplate.
Blocked on https://github.com/actions/cache/issues/55
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Cache Gradle wrapper and other Gradle caches between ...
Github Actions agents are ephemeral, Gradle builds need to download the Gradle distribution, generate API jars, download dependencies etc.
Read more >Configuration cache - Gradle User Manual
The build cache takes care of caching the outputs and intermediate files of the build, such as task outputs or artifact transform outputs....
Read more >Executing Gradle builds on GitHub Actions
The following workflow file instructs GitHub Actions to build your Gradle project using the Gradle Wrapper, executed by the default Java distribution for...
Read more >Build Cache - Gradle User Manual
The Gradle build cache is a cache mechanism that aims to save time by reusing outputs produced by other builds. The build cache...
Read more >The Gradle Wrapper - Gradle User Manual
Standardizes a project on a given Gradle version, leading to more reliable and robust builds. · Provisioning a new Gradle version to different...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like v2 supports this now https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action
Cool, will do, thanks.