Skip to content

Conversation

@RBusarow
Copy link
Contributor

The older action, burrunan/gradle-cache-action, turns GitHub's freebie storage into a remote Gradle build cache. This causes tons of small requests, and as a result we sometimes get 429 errors or timeouts. When this happens, the best case scenario is that Gradle just treats it as a cache miss and rebuilds something locally. In the worst case, CI just fails.

This replacement action is Gradle's own. It automatically handles keys and partitioning of the caches, and still uses build cache instead of /build. But, it saves/restores those caches in large chunks instead of making a remote build cache. As a result, the I/O is faster and there are far fewer requests.

The older action, `burrunan/gradle-cache-action`, turns GitHub's freebie storage into a remote Gradle build cache.  This causes tons of small requests, and as a result we sometimes get 429 errors or timeouts.  When this happens, the best case scenario is that Gradle just treats it as a cache miss and rebuilds something locally.  In the worst case, CI just fails.

This replacement action is Gradle's own.  It automatically handles keys and partitioning of the caches, and still uses build cache instead of `/build`.  But, it saves/restores those caches in large chunks instead of making a remote build cache.  As a result, the I/O is faster and there are far fewer requests.
concurrent : true
gradle-build-scan-report : false
gradle-distribution-sha-256-sum-warning : false
assemble --stacktrace
Copy link
Collaborator

Choose a reason for hiding this comment

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

I take it --no-daemon is built in now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More or less.
https://github.com/gradle/gradle-build-action#stopping-the-gradle-daemon

By default, the action will stop all running Gradle daemons in the post-action step, prior to saving the Gradle User Home state. This allows for any Gradle User Home cleanup to occur, and avoid file-locking issues on Windows.

If caching is unavailable or the cache is in read-only mode, the daemon will not be stopped and will continue running after the job is completed.

Copy link
Contributor

@steve-the-edwards steve-the-edwards left a comment

Choose a reason for hiding this comment

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

Love it!

@RBusarow RBusarow marked this pull request as ready for review June 27, 2022 17:17
@RBusarow RBusarow requested review from a team and zach-klippenstein as code owners June 27, 2022 17:17
@RBusarow RBusarow merged commit 39db0a7 into main Jun 27, 2022
@RBusarow RBusarow deleted the rick/gradle/gradle-build-action branch June 27, 2022 17:17
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.

4 participants