Skip to content

Commit

Permalink
[ci] Report issues in the API docs build log (#7784)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pjcollins authored Feb 13, 2023
1 parent 4558c0e commit 7c42c60
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build-tools/automation/azure-pipelines-apidocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,25 @@ stages:
inputs:
artifactName: Api Docs Diff
targetPath: $(Build.StagingDirectory)/api-doc-diff

- powershell: |
$docsUpdateBinlog = Get-ChildItem -Path "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)" -Filter *UpdateApiDocs-*.binlog | Select-Object -First 1
$buildLog = "$(Build.SourcesDirectory)/bin/Build$(XA.Build.Configuration)/temp-build.log"
& "$(Build.SourcesDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet" build $docsUpdateBinlog > $buildLog
$issueContent = & {
Get-Content -Path $buildLog | Select-String "## Exception translating remarks"
Get-Content -Path $buildLog | Select-String "## Unable to translate remarks"
Get-Content -Path $buildLog | Select-String "JavadocImport-"
}
if ($issueContent) {
Write-Host "The following issues were found, review the build log for more details:"
Write-Host ""
foreach ($line in $issueContent) {
Write-Host $line
Write-Host ""
}
exit 1
}
displayName: Report issues in docs generation

0 comments on commit 7c42c60

Please sign in to comment.