Skip to content
Draft
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/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ updates:
directory: "/"
allow:
- dependency-name: "com.gradle*"
- dependency-name: "com.diffplug.spotless"
registries:
- gradle-plugin-portal
schedule:
Expand Down
46 changes: 35 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,18 @@ jobs:
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
set -o pipefail
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'del(.[] | select(. == ":testcontainers:check" or startswith(":docs:")))' --compact-output)
echo $TASKS
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then map(select(. != ":testcontainers:check" and (startswith(":docs:") | not)))
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
| if length > 0 then . else error("testMatrix produced no core Gradle tasks") end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT"
check:
needs: [find_gradle_jobs]
strategy:
Expand Down Expand Up @@ -131,9 +139,17 @@ jobs:
# 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
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/examples-test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then .
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT"
check_examples:
needs: [find_examples_jobs]
strategy:
Expand Down Expand Up @@ -165,10 +181,18 @@ jobs:
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
set -o pipefail
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'map(select(startswith(":docs:")))' --compact-output)
echo $TASKS
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/docs-test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then map(select(startswith(":docs:")))
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
| if length > 0 then . else error("testMatrix produced no docs Gradle tasks") end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT"
check_docs_examples:
needs: [find_docs_examples_jobs]
strategy:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
id 'io.franzbecker.gradle-lombok' version '5.0.0'
id 'com.gradleup.shadow' version '8.3.9'
id 'me.champeau.gradle.japicmp' version '0.4.3' apply false
id 'com.diffplug.spotless' version '6.22.0' apply false
id 'com.diffplug.spotless' version '8.10.1' apply false
id 'org.jreleaser' version '1.20.0' apply false
}

Expand Down
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// empty build.gradle for dependabot
plugins {
id 'com.diffplug.spotless' version '6.22.0' apply false
id 'com.diffplug.spotless' version '8.10.1' apply false
}

apply from: "$rootDir/../gradle/ci-support.gradle"
Expand Down
24 changes: 8 additions & 16 deletions gradle/ci-support.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,20 @@ task testMatrix {
it.tasks.findByName("check")
}.findAll { it != null }

dependsOn(checkTasks)
doLast {
def checkTaskPaths = checkTasks
.collect { it.path }

println(JsonOutput.toJson(checkTaskPaths))
}
}
}
def json = JsonOutput.toJson(checkTaskPaths)
def outputPath = providers.gradleProperty("testMatrixOutput").getOrNull()

// If we're executing the `testMatrix` task, disable tests and other slow tasks
// so that we can get a result quickly.
gradle.taskGraph.whenReady {
if (it.hasTask(tasks.testMatrix)) {
for (subproject in subprojects) {
subproject.tasks.withType(Test).all {
testExecuter([execute: { spec, processor -> }, stopNow:{}] as org.gradle.api.internal.tasks.testing.TestExecuter)
if (outputPath != null) {
def outputFile = file(outputPath)
outputFile.parentFile.mkdirs()
outputFile.text = json + System.lineSeparator()
} else {
println(json)
}
subproject.tasks.findByName("shadowJar")?.enabled = false
subproject.tasks.findByName("javadoc")?.enabled = false
subproject.tasks.findByName("delombok")?.enabled = false
subproject.tasks.findByName("japicmp")?.enabled = false
}
}
}
2 changes: 1 addition & 1 deletion smoke-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// empty build.gradle for dependabot
plugins {
id 'com.diffplug.spotless' version '6.22.0' apply false
id 'com.diffplug.spotless' version '8.10.1' apply false
}

apply from: "$rootDir/../gradle/ci-support.gradle"
Expand Down
Loading