Skip to content

Commit

Permalink
[CI] Simplify error log upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Jan 16, 2025
1 parent 9a9c283 commit fd46e73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd46e73

Please sign in to comment.