Skip to content

Commit 7c42c60

Browse files
authored
[ci] Report issues in the API docs build log (#7784)
Context: dotnet/java-interop#1071 Adds a step to the API docs build that will fail the job if any problematic JavadocInfo messages are found in the log.
1 parent 4558c0e commit 7c42c60

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

build-tools/automation/azure-pipelines-apidocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,25 @@ stages:
117117
inputs:
118118
artifactName: Api Docs Diff
119119
targetPath: $(Build.StagingDirectory)/api-doc-diff
120+
121+
- powershell: |
122+
$docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1
123+
$buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-build.log"
124+
& "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog
125+
126+
$issueContent = & {
127+
Get-Content -Path $buildLog | Select-String "## Exception translating remarks"
128+
Get-Content -Path $buildLog | Select-String "## Unable to translate remarks"
129+
Get-Content -Path $buildLog | Select-String "JavadocImport-"
130+
}
131+
132+
if ($issueContent) {
133+
Write-Host "The following issues were found, review the build log for more details:"
134+
Write-Host ""
135+
foreach ($line in $issueContent) {
136+
Write-Host $line
137+
Write-Host ""
138+
}
139+
exit 1
140+
}
141+
displayName: Report issues in docs generation

0 commit comments

Comments
 (0)