Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xcode12.5] [CI] Remove duplicated status. #11285

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
11 changes: 9 additions & 2 deletions tools/devops/automation/scripts/GitHub.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,18 @@ function New-GitHubSummaryComment {
Set-GitHubStatus -Status "failure" -Description "Tests failed catastrophically on $Context (no summary found)." -Context "$Context"
$request = New-GitHubComment -Header "Tests failed catastrophically on $Context (no summary found)." -Emoji ":fire:" -Description "Result file $TestSummaryPath not found. $headerLinks"
} else {

# set the context to be "pipeline name (Test run)", example xamarin-macios (Test run)
$statusContext = "$Env:BUILD_DEFINITIONNAME (Test run)"
if ($Context -ne "Build") { #special case when we deal with the device tests
$statusContext = "$Contex - $Env:BUILD_DEFINITIONNAME) (Test run)"
}

if (Test-JobSuccess -Status $Env:TESTS_JOBSTATUS) {
Set-GitHubStatus -Status "success" -Description "Tests passed on $Context." -Context "$Context"
Set-GitHubStatus -Status "success" -Description "All tests passed on $Context." -Context $statusContext
$request = New-GitHubCommentFromFile -Header "Tests passed on $Context." -Description "Tests passed on $Context. $headerLinks" -Emoji ":white_check_mark:" -Path $TestSummaryPath
} else {
Set-GitHubStatus -Status "failure" -Description "Tests failed on $Context." -Context "$Context"
Set-GitHubStatus -Status "error" -Description "Tests failed on $Context." -Context $statusContext
$request = New-GitHubCommentFromFile -Header "Tests failed on $Context" -Description "Tests failed on $Context. $headerLinks" -Emoji ":x:" -Path $TestSummaryPath
}
}
Expand Down
7 changes: 0 additions & 7 deletions tools/devops/automation/templates/build/publish-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ steps:
$response = New-GitHubSummaryComment -Context "$Env:CONTEXT" -TestSummaryPath "$Env:TESTS_SUMMARY" -APIDiff "$Env:APIDIFF_JSON_PATH"
Write-Host $response
}
if($Env:TESTS_JOBSTATUS -ne "Succeeded")
{
Set-PipelineResult -Status partiallySucceeded
Set-GitHubStatus -Status "error" -Description "Some tests failed." -Context "$(Build.DefinitionName) (Test run)"
} else {
Set-GitHubStatus -Status "success" -Description "All tests passed." -Context "$(Build.DefinitionName) (Test run)"
}
env:
BUILD_REVISION: $(Build.SourceVersion)
CONTEXT: ${{ parameters.statusContext }}
Expand Down