Skip to content
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

infrastructure: enable Gradle build cache by default #2711

Merged
merged 3 commits into from Dec 13, 2022

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Oct 13, 2022

Enables Gradle Build Cache. This should massively increase build speed on CI/CD as Gradle will be able to avoid doing repetitive work.

Since all of the GitHub Actions use the gradle/gradle-build-action action, this will automatically share the Gradle Build Cache. (I also added gradle/gradle-build-action in the Maven workflow, because I expect the $USER_HOME/.m2 will be shared and re-used - if not this can be revisited later).

I expect that the GitHub Action build times will improve dramatically, especially for PRs like this where there are no code changes!

(Note that the caching won't be enabled on this PR, because by default only the master/main branch will cache. This is to avoid multiple jobs updating the cache concurrently.)

Copy link
Contributor

@Goooler Goooler left a comment

Choose a reason for hiding this comment

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

Is there any source point that gradle/gradle-build-action can cache .m2 folder?

@aSemy
Copy link
Contributor Author

aSemy commented Oct 19, 2022

Is there any source point that gradle/gradle-build-action can cache .m2 folder?

In the documentation it describes how to disable caching ~/.m2/repository

 # ...
    # Disable caching of ~/.m2/repository/
    save-maven-dependencies-cache: false

@Goooler
Copy link
Contributor

Goooler commented Oct 19, 2022

In the documentation it describes how to disable caching ~/.m2/repository

But this is burrunan/gradle-cache-action instead of gradle/gradle-build-action, I can't find anything that contains .m2 or save-maven-dependencies-cache in the Gradle's.

@Goooler
Copy link
Contributor

Goooler commented Oct 19, 2022

I believe you just enable org.gradle.caching is ok.

@aSemy
Copy link
Contributor Author

aSemy commented Oct 19, 2022

You are right! Thanks for checking. I've removed it.

I see there's Maven caching for setup-java, which I must have gotten mixed up with. I'll make another PR for enabling that. https://github.com/actions/setup-java#caching-maven-dependencies

@aSemy aSemy changed the title enable Gradle build cache by default [ci/cd] enable Gradle build cache by default Oct 19, 2022
@aSemy aSemy changed the title [ci/cd] enable Gradle build cache by default build config: enable Gradle build cache by default Oct 19, 2022
@aSemy aSemy changed the title build config: enable Gradle build cache by default infrastructure: enable Gradle build cache by default Nov 4, 2022
Copy link
Member

@IgnatBeresnev IgnatBeresnev left a comment

Choose a reason for hiding this comment

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

Shouldn't hurt

Thanks to both of you :)

@IgnatBeresnev IgnatBeresnev merged commit f289e2e into Kotlin:master Dec 13, 2022
IgnatBeresnev added a commit that referenced this pull request Jan 26, 2023
Because integration tests are cached by default, it produces no output for showcasing documentation through S3 or GitHub artifacts.

Regression from #2711
@aSemy aSemy deleted the feat/enable_gradle_build_cache branch January 28, 2023 22:41
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.

None yet

3 participants