From e1b4eb03a53f19647e77e35571fb580af997935a Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Fri, 10 Jul 2026 06:20:52 +0200 Subject: [PATCH] Upload TestCases folder as artifact when CI tests fail Failed decompiler-test runs leave their generated fixtures (compiled test assemblies, generated IL, diff inputs) on the runner where they are lost, making CI-only failures hard to diagnose. Capture the folder via upload-artifact's own client-side zip at compression-level 9 instead of a separate 7z step, since 7z is not reliably available on the macOS runner. Assisted-by: Claude:claude-fable-5:Claude Code --- .github/workflows/build-ilspy.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 8c0857899..1134460a0 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -90,6 +90,7 @@ jobs: run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.sln - name: Execute unit tests + id: unit-tests run: > dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} @@ -103,6 +104,14 @@ jobs: name: test-results-${{ matrix.configuration }} path: 'test-results/${{ matrix.configuration }}/*.trx' + - name: Upload TestCases on test failure + uses: actions/upload-artifact@v7 + if: failure() && steps.unit-tests.outcome == 'failure' + with: + name: testcases-${{ matrix.configuration }} + path: ICSharpCode.Decompiler.Tests/TestCases + compression-level: 9 + - name: Create Test Report uses: test-summary/action@v2 if: always() @@ -324,6 +333,7 @@ jobs: --results-directory test-results - name: Execute decompiler tests + id: decompiler-tests run: > dotnet test --project ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj --configuration Release @@ -337,6 +347,14 @@ jobs: name: test-results-${{ matrix.platform }} path: 'test-results/*.trx' + - name: Upload TestCases on test failure + uses: actions/upload-artifact@v7 + if: failure() && steps.decompiler-tests.outcome == 'failure' + with: + name: testcases-${{ matrix.platform }} + path: ICSharpCode.Decompiler.Tests/TestCases + compression-level: 9 + - name: Create Test Report uses: test-summary/action@v2 if: always()