From fd46e73d76819c2e0d2727edfc9f9ccfeed26f59 Mon Sep 17 00:00:00 2001 From: Dmytro Vyazelenko <696855+vyazelenko@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:44:29 +0100 Subject: [PATCH] [CI] Simplify error log upload. --- .github/workflows/ci.yml | 20 ++++---------------- .github/workflows/slow.yml | 8 ++++---- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2b568bb7..83e080689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,30 +71,18 @@ jobs: java-version: 17 - name: Build with Gradle run: ./gradlew - - name: Copy test logs (Unix) + - name: Copy test logs id: copy_test_logs - if: failure() && runner.os != 'Windows' + if: failure() run: | - echo "file=build/distributions/test_logs.tbz2" >> $GITHUB_OUTPUT + ${{ runner.os == 'Windows' && 'echo "file=build/distributions/test_logs.tbz2" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append' || 'echo "file=build/distributions/test_logs.tbz2" >> $GITHUB_OUTPUT' }} ./gradlew tarTestLogs - - name: Upload crash logs (Unix) + - name: Upload crash logs if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' uses: actions/upload-artifact@v4 with: name: crash-logs-${{ matrix.os }}-java-${{ matrix.java }} path: ${{ steps.copy_test_logs.outputs.file }} - - name: Copy test logs (Windows) - id: copy_test_logs_windows - if: runner.os == 'Windows' && failure() - run: | - echo "file=build/distributions/test_logs.tbz2" | Out-File $env:GITHUB_OUTPUT -Encoding utf8 -Append - ./gradlew tarTestLogs - - name: Upload crash logs (Windows) - if: runner.os == 'Windows' && always() && steps.copy_test_logs_windows.outputs.file == 'build/distributions/test_logs.tbz2' - uses: actions/upload-artifact@v4 - with: - name: crash-logs-${{ matrix.os }}-java-${{ matrix.java }} - path: ${{ steps.copy_test_logs_windows.outputs.file }} csharp-build: name: C# ${{ matrix.dotnet }} diff --git a/.github/workflows/slow.yml b/.github/workflows/slow.yml index 915a097ec..424e7f3bc 100644 --- a/.github/workflows/slow.yml +++ b/.github/workflows/slow.yml @@ -55,17 +55,17 @@ jobs: run: ./csharp/build.sh - name: Run property tests run: ./gradlew propertyTest - - name: Copy test logs (Unix) + - name: Copy test logs id: copy_test_logs if: failure() run: | - echo "file=build/distributions/test_logs.tbz2" >> $GITHUB_OUTPUT + ${{ runner.os == 'Windows' && 'echo "file=build/distributions/test_logs.tbz2" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append' || 'echo "file=build/distributions/test_logs.tbz2" >> $GITHUB_OUTPUT' }} ./gradlew tarTestLogs - - name: Upload crash logs (Unix) + - name: Upload crash logs if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' uses: actions/upload-artifact@v4 with: - name: crash-logs-${{ matrix.os }}-property-tests + name: crash-logs-${{ matrix.os }}-property-tests-java-${{matrix.java}}-dotnet-${{matrix.dotnet}} path: ${{ steps.copy_test_logs.outputs.file }} - name: Upload test results uses: actions/upload-artifact@v4