Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}

jobs:
find_gradle_jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}

jobs:
thundra_test_initializer:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ src/mkdocs-codeinclude-plugin
src/pip-delete-this-directory.txt

.DS_Store

# Codespaces / VSCode
/.vscode/
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ subprojects {
task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask) {
def outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
outputs.cacheIf {
true
}
for (srcDir in project.sourceSets.main.java.srcDirs) {
// TODO: named input and relative path for `srcDir` to make task more cacheable
inputs.dir(srcDir)
args(srcDir, "-d", outputDir)
// TODO: `outputDir` as relative path to make task more cacheable
Comment on lines +53 to +55
Copy link
Member Author

Choose a reason for hiding this comment

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

We can improve this as a follow-up, to make caching between local-ci better.

args(srcDir, "-d", outputDir, "-f", "generateDelombokComment:skip")
}
}
delombok.onlyIf {
Expand Down
2 changes: 1 addition & 1 deletion examples/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.6.1"
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.7.2"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.parallel=false
org.gradle.caching=true

org.gradle.configureondemand=true
Copy link
Member Author

Choose a reason for hiding this comment

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

This was also recommended.

31 changes: 14 additions & 17 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0"
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.6.1"
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.2.1"
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.7.2"
classpath "com.gradle:common-custom-user-data-gradle-plugin:1.6.1"
}
}

apply plugin: 'ch.myniva.s3-build-cache'
apply plugin: 'com.gradle.enterprise'
apply plugin: "com.gradle.common-custom-user-data-gradle-plugin"

Expand All @@ -38,21 +36,20 @@ ext.isMasterBuild = false ||
(System.getenv("GITHUB_REF") == "refs/heads/master") ||
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master")

ext.isCI = System.getenv("CI") != null

buildCache {
local {
enabled = !isMasterBuild
enabled = !isCI
}

remote(ch.myniva.gradle.caching.s3.AwsS3BuildCache) {
endpoint = 'fra1.digitaloceanspaces.com'
region = 'fra1'
bucket = 'testcontainers'
path = 'cache'
reducedRedundancy = false
push = isMasterBuild && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE")
headers = [
'x-amz-acl': 'public-read'
]
remote(HttpBuildCache) {
push = isCI
Copy link
Member Author

Choose a reason for hiding this comment

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

Gradle colleagues recommended to always push to cache, to get a better populated cache.

enabled = true
url = 'https://ge.testcontainers.org/cache/'
credentials {
username = 'ci'
password = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
}
}
}

Expand All @@ -61,7 +58,7 @@ gradleEnterprise {
server = "https://ge.testcontainers.org/"
publishAlways()
publishIfAuthenticated()
uploadInBackground = System.getenv("CI") == null
uploadInBackground = !isCI
captureTaskInputFiles = true
}

Expand Down