From 64a1d63656a673e2a146d32cd67eceb015e73c27 Mon Sep 17 00:00:00 2001 From: Chaim Date: Mon, 11 May 2026 16:19:33 +0000 Subject: [PATCH] ci: dump msbuild log to artifact so we can debug failures via API Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 617c4c0..2e1a5d0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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"