Skip to content

Commit

Permalink
Optimize remote build cache with mark push=false
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Mar 9, 2021
1 parent bbff155 commit b2dbff6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2021-03-09: v1.9 🚀 optimize remote build cache with mark push=false

Previously `read-only` was implemented as "skip saving the caches",
however it makes sense to configure `push=false` so Gradle skips cache entry preparation as well.

## 2021-03-09: v1.8 🚑 support Gradle 5

Support Gradle 5 (and possibly even earlier versions).
Expand Down
1 change: 1 addition & 0 deletions cache-action-entrypoint/src/main/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ suspend fun mainInternal(stage: ActionStage) {
multiCacheVersion = getInput("multi-cache-version").ifBlank { "1.0" },
multiCacheRepository = getInput("multi-cache-repository"),
multiCacheGroupIdFilter = getInput("multi-cache-group-id-filter").ifBlank { "com[.]github[.]burrunan[.]multi-?cache" },
push = !params.readOnly,
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class CacheProxy {
multiCacheEnabled: Boolean = true,
multiCacheVersion: String = "1.0",
multiCacheRepository: String = "",
multiCacheGroupIdFilter: String = "com[.]github[.]burrunan[.]multi-?cache"
multiCacheGroupIdFilter: String = "com[.]github[.]burrunan[.]multi-?cache",
push: Boolean = true,
): String {
val multiCacheGroupIdFilterEscaped = multiCacheGroupIdFilter.replace("\\", "\\\\")
//language=Groovy
Expand Down Expand Up @@ -165,7 +166,7 @@ class CacheProxy {
}
remote(HttpBuildCache) {
url = '$cacheUrl'
push = true
push = $push
// Build cache is located on localhost, so it is fine to use http protocol
if (gradle6Plus) {
allowInsecureProtocol = true
Expand Down

0 comments on commit b2dbff6

Please # to comment.