-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for configuration cache (#118)
- Loading branch information
1 parent
62f5d5d
commit da5be81
Showing
15 changed files
with
482 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
if (!project.hasProperty('githubCiTesting') && System.env['GITHUB_OUTPUT'] == null) { | ||
// If the property is not set and we are not running in the CI environment then we will do nothing | ||
return | ||
} | ||
|
||
static def outputUnitTest(Project project, Task test) { | ||
project.getLogger().lifecycle("<< TEST >>${test.path}") | ||
} | ||
|
||
static def outputClassTest(Project project, Task test, String className) { | ||
project.getLogger().lifecycle("<< TEST >>${test.path} --tests \"${className}\"") | ||
} | ||
|
||
subprojects.forEach { Project subProject -> | ||
subProject.tasks.register('determineTests') { Task it -> | ||
it.group = 'infrastructure' | ||
it.doLast { | ||
subProject.tasks.withType(Test).forEach { Task test -> | ||
def testSourceSetCandidate = test.extensions.findByName('test-source-set') | ||
if (testSourceSetCandidate != null) { | ||
SourceSet testSourceSet = testSourceSetCandidate as SourceSet | ||
|
||
testSourceSet.java.srcDirs | ||
.collect { File file -> | ||
subProject.fileTree(file.parentFile) | ||
} | ||
.collect { FileTree fileTree -> | ||
return fileTree.matching { | ||
include '**/*Test.java' | ||
include '**/*Tests.java' | ||
include '**/*Test.groovy' | ||
include '**/*Tests.groovy' | ||
} | ||
} | ||
.forEach { | ||
it.visit { FileVisitDetails details -> | ||
if (details.isDirectory()) | ||
return; | ||
|
||
String className = details.relativePath.pathString | ||
.replace("groovy/", "") | ||
.replace("java/", "") | ||
.replace(".groovy", "") | ||
.replace(".java", "") | ||
.replace("/", ".") | ||
|
||
outputClassTest(subProject, test, className) | ||
} | ||
} | ||
|
||
} else { | ||
outputUnitTest(subProject, test) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
./gradlew determineTests | grep -e '<< TEST >>' | sed -e 's/<< TEST >>//g' > ./tasks | ||
TESTS=$(cat tasks | jq --raw-input . | jq --compact-output --slurp .) | ||
# Check if the GITHUB_OUTPUT is set | ||
if [ -z "$GITHUB_OUTPUT" ]; then | ||
# We do not have github output, then use the set output command | ||
echo "::set-output name=tests-to-run::$TESTS" | ||
exit 0 | ||
fi | ||
echo "tests-to-run=$TESTS" >> "$GITHUB_OUTPUT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.