mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Catch more build failures in job summary (#571)
By inspecting a greater range of build operations for failure, the Job summary will correctly reflect the build outcome in more circumstances. Note that we now use the old 'buildFinished' mechanism for all Gradle versions < `7.0`, instead of using the BuildService mechanism for all Gradle versions from `6.6`. This avoids needing to deal with inconsistent build operations present in Gradle versions `[6.6, 7.0)`. Fixes #415
This commit is contained in:
@@ -41,10 +41,8 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
|
||||
// Got EVALUATE SETTINGS event: not a config-cache hit"
|
||||
configCacheHit = false
|
||||
}
|
||||
if (buildOperation.details in RunRootBuildWorkBuildOperationType.Details) {
|
||||
if (finishEvent.failure != null) {
|
||||
buildFailed = true
|
||||
}
|
||||
if (finishEvent.failure != null) {
|
||||
buildFailed = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ if (isTopLevelBuild) {
|
||||
|
||||
def atLeastGradle3 = version >= GradleVersion.version("3.0")
|
||||
def atLeastGradle6 = version >= GradleVersion.version("6.0")
|
||||
def atLeastGradle7 = version >= GradleVersion.version("7.0")
|
||||
|
||||
def invocationId = "-${System.currentTimeMillis()}"
|
||||
|
||||
if (atLeastGradle6) {
|
||||
// By default, use standard mechanisms to capture build results
|
||||
def useBuildService = version >= GradleVersion.version("6.6")
|
||||
if (useBuildService) {
|
||||
// Use BuildService for modern Gradle versions
|
||||
if (atLeastGradle7) {
|
||||
captureUsingBuildService(invocationId)
|
||||
} else {
|
||||
captureUsingBuildFinished(gradle, invocationId, resultsWriter)
|
||||
|
||||
Reference in New Issue
Block a user