Skip to content

Commit

Permalink
Push Gradle Cache from GHA (#2597)
Browse files Browse the repository at this point in the history
* Push Gradle Cache from GHA

* Update ci.yml
  • Loading branch information
bsideup committed Apr 21, 2020
1 parent d604f3e commit 9c4756f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -23,6 +23,10 @@ jobs:
${{ runner.os }}-gradle-home-testmatrix-
${{ runner.os }}-gradle-home-
- id: set-matrix
env:
# Since we override the tests executor,
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix)
echo $TASKS
Expand Down
14 changes: 5 additions & 9 deletions settings.gradle
Expand Up @@ -5,21 +5,17 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.9.0"
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.2.1"
}

configurations.classpath {
resolutionStrategy {
force 'com.amazonaws:aws-java-sdk-s3:1.11.582'
}
}
}

apply plugin: 'ch.myniva.s3-build-cache'
apply plugin: 'com.gradle.enterprise'

ext.isMasterBuild = (System.getenv("CIRCLE_BRANCH") ?: System.getenv("BUILD_SOURCEBRANCHNAME")) == "master"
ext.isMasterBuild = false ||
(System.getenv("GITHUB_REF") == "refs/heads/master") ||
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master")

buildCache {
local {
Expand All @@ -31,7 +27,7 @@ buildCache {
region = 'fra1'
bucket = 'testcontainers'
path = 'cache'
push = isMasterBuild
push = !(System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE") || !isMasterBuild)
headers = [
'x-amz-acl': 'public-read'
]
Expand Down

0 comments on commit 9c4756f

Please sign in to comment.