GitHub Actions: Show log files in Windows jobs

If CPack fails, it may write the actual errors to a dedicated log file:

    EXEC : CPack error : Problem running WiX. Please check 'D:/a/icinga2/icinga2/Build/_CPack_Packages/win64/WIX/wix.log' for errors. [D:\a\icinga2\icinga2\Build\PACKAGE.vcxproj]

Show all `*.log` files as part of the job output so that it doesn't get lost.
This commit is contained in:
Julian Brost 2025-05-14 09:56:57 +02:00
parent d230e87cf2
commit 5a464afdaa

View File

@ -46,3 +46,12 @@ jobs:
if ($LastExitCode -ne 0) { throw "Error during build" }
& powershell.exe .\tools\win32\test.ps1
if ($LastExitCode -ne 0) { throw "Error during test" }
- name: Show Log Files
if: ${{ always() }}
run: |
foreach ($file in Get-ChildItem -Recurse -Filter "*.log") {
Write-Host "::group::$($file.FullName)"
Get-Content $file.FullName
Write-Host "::endgroup::"
}