Skip to content

Conversation

@Luna712
Copy link
Contributor

@Luna712 Luna712 commented Nov 21, 2025

This requires adding a new secret in GitHub settings, GRADLE_ENCRYPTION_KEY which can be generated with openssl rand -base64 16.

This significantly improves caching performance, not only supporting build cache, but configuration cache as well. The encryption key is necessary to enable that for security. It won't work without it.

Using this action also provides more information on build status in workflow results page. It also adds validation for wrapper jar files.

Marked as draft for now because while I have tested this some, I need to test this more before also adding to prerelease and other actions.

This requires adding a new secret in GitHub settings, `GRADLE_ENCRYPTION_KEY` which can be generated with `openssl rand -base64 16`.

This significantly improves caching performance, not only supporting build cache, but configuration cache as well. The encryption key is necessary to enable that for security. It won't work without it. Using this action also provides more information on build status in workflow results page.
@Luna712
Copy link
Contributor Author

Luna712 commented Nov 21, 2025

When it ends up using configuration cache it builds in 17 seconds. Note that configuration cache does get invalidated when almost anything is changed (including .git/HEAD which means any git commit at all) for safety (because the file is checked in exec so that it updates properly with the git commit displayed in settings). But this does have some advantages when rerunning builds or something, and if they change what invalidates it or something in the future.

Screenshot_20251121_155547_Chrome

And the result summary that would now be shown:
Screenshot_20251121_155619_Chrome

@Luna712
Copy link
Contributor Author

Luna712 commented Nov 22, 2025

Im working on a new truly configuration cache supported version of the git commit, once that is finished this will be much more useful, in the meantime, all my testing indicates this works very well and also helps speed up the build drastically even when things like build.gradle.kts is changed, and only purges the cache and rebuilds when actual packages are changed making the cache smarter and faster in more circumstances as well.

@Luna712
Copy link
Contributor Author

Luna712 commented Nov 23, 2025

This will remain a draft until #2206 is merged, as with that, I think I found a way to make the git commit stuff fully configuration cache compatible (but couldn't figure out how to using the legacy buildscript/classpath method) so it doesn't prevent reuse when .git/HEAD is changed. And when configuration cache is fully used, I got prerelease to build in 40 seconds (down from 10-15 minutes that it used to be)

@Luna712 Luna712 marked this pull request as ready for review November 24, 2025 17:55
@Luna712
Copy link
Contributor Author

Luna712 commented Nov 24, 2025

I still need to make the git stuff truly support configuration cache but what I thought was working was actually just changing what invalides it (exec output instead of file) the 40 seconds for pre release does work when we don't invalidate (like if the git code is commented out) so if we can get it to support it will be a massive benefit (I think its possible its just more difficult then I thought for me anyway).

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