question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache Gradle wrapper and other Gradle caches between workflow executions

See original GitHub issue

Github 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found