From 5be74c49181d788192a6467d2262441ae5cbd38b Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Tue, 27 Aug 2024 10:27:41 -0700 Subject: [PATCH] Add binary logging and upload those logs on failure --- .github/workflows/build.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c6d55181..4d5a5a14e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,13 +19,13 @@ jobs: fetch-depth: '0' - name: Build project - run: dotnet build --configuration Release + run: dotnet build -bl:build.binlog --configuration Release # there are cases where this will fail and we want to know about it # so we don't use continue-on-error, but we still want to publish the results - name: Test project id: test - run: dotnet test --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results + run: dotnet test -bl:test.binlog --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results - name: Publish test results if: ${{ !cancelled() && steps.test.outcome != 'skipped' }} @@ -34,4 +34,13 @@ jobs: check_name: LibPalaso Tests files: ./test-results/**/*.trx action_fail: true - action_fail_on_inconclusive: true \ No newline at end of file + action_fail_on_inconclusive: true + + - name: Publish logs on failure + if: failure() + uses: actions/upload-artifact@v3 + with: + name: binary-logs + path: | + build.binlog + test.binlog \ No newline at end of file