ci: dump msbuild log to artifact so we can debug failures via API

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:19:33 +00:00
parent a8af5e3749
commit 64a1d63656
+20 -1
View File
@@ -80,7 +80,26 @@ jobs:
# `msbuild /restore` runs restore and build in the same MSBuild process,
# so the package cache + project.assets.json + assembly resolution stay
# consistent (avoids NETSDK1064).
run: msbuild OutlookAddin.sln /restore /t:Build /p:Configuration=Release /p:Platform="Any CPU" /m
# /flp dumps detailed log to build.log so we can retrieve it via the
# Gitea Actions artifacts API even when MSBuild fails mid-target.
shell: powershell
run: |
msbuild OutlookAddin.sln /restore /t:Build /p:Configuration=Release /p:Platform="Any CPU" /m `
/flp:logfile=build.log`;verbosity=detailed `
/flp1:logfile=build-errors.log`;errorsonly `
/flp2:logfile=build-warnings.log`;warningsonly
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ github.run_id }}
path: |
build.log
build-errors.log
build-warnings.log
retention-days: 7
- name: Test
run: dotnet test src/OutlookAddin.Tests/OutlookAddin.Tests.csproj --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"