Skip to content

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Jun 21, 2024

Enables a remote Gradle Build Cache, allowing build cache results to be shared between machines. This will be a significant improvement in build times on CI and locally, and in reducing the (currently overloaded) cache-usage of GitHub Actions.

Huge credit and thanks to @Kantis for providing a server!

Early preview

Please test out the remote build cache server by creating an init script:
$GRADLE_USER_HOME/init.d/kotest-build-cache.init.gradle.kts

(or if you don't have GRADLE_USER_HOME env var, in ~/.gradle/init.d/kotest-build-cache.init.gradle.kts)

gradle.settingsEvaluated {
   if (rootProject.name == "kotest") {
      buildCache {
         remote<HttpBuildCache> {
            if (url != null) {
               logger.warn("Kotest remote build cache is already configured. You might want to remove \$GRADLE_USER_HOME/init.d/kotest-build-cache.init.gradle.kts.")
            } else {
               logger.lifecycle("Configuring Kotest remote build cache 🚀")
               url = uri("https://kotest-gradle.duckdns.org/cache")
               isPush = false
            }
         }
      }
   }
}

Tasks

  • We are currently waiting to configure a nice URL with a SSL cert instead of an IP address.

@aSemy aSemy force-pushed the adam/feat/gradle-remote-build-cache branch 3 times, most recently from 0a2e21c to 01d5b51 Compare June 21, 2024 21:49
@aSemy aSemy mentioned this pull request Jun 22, 2024
@aSemy aSemy force-pushed the adam/feat/gradle-remote-build-cache branch from 7e4d892 to 2be4bfb Compare June 22, 2024 09:58
@aSemy aSemy force-pushed the adam/feat/gradle-remote-build-cache branch from 2be4bfb to 43d74f8 Compare June 22, 2024 11:47
@Kantis Kantis added the builds 🐘 PRs / Issues related to the CI/CD pipelines or Gradle builds label Jun 24, 2024
@aSemy aSemy marked this pull request as ready for review July 9, 2024 21:43
@aSemy aSemy requested review from OliverO2 and Kantis July 9, 2024 21:43
@aSemy
Copy link
Contributor Author

aSemy commented Jul 9, 2024

The build scan shows 53 minutes of avoidance savings thanks to remote build cache!

image

I don't think 53 minutes sounds quite right... it sounds like a very long time, and I don't think the tests take 1 hour+ on macOS, but I'm sure that the actual savings will be significant.

@aSemy aSemy merged commit 4351fea into master Jul 11, 2024
@aSemy aSemy deleted the adam/feat/gradle-remote-build-cache branch July 11, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds 🐘 PRs / Issues related to the CI/CD pipelines or Gradle builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants