Skip to content

Commit

Permalink
[CI] Simplify crash logs upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Jan 16, 2025
1 parent 15ad44b commit 77780a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 61 deletions.
40 changes: 8 additions & 32 deletions .github/workflows/ci-low-cadence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,18 @@ jobs:
java-version: 17
- name: Build with Gradle
run: ./gradlew clean build :agrona-concurrency-tests:concurrencyTests
- 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 }}

ea-build:
name: Java ${{ matrix.java }} (${{ matrix.os }})
Expand Down Expand Up @@ -142,27 +130,15 @@ jobs:
java-version: 17
- name: Build with Gradle
run: ./gradlew clean build :agrona-concurrency-tests:concurrencyTests
- 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-ea-${{ 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-ea-${{ matrix.os }}-java-${{ matrix.java }}
path: ${{ steps.copy_test_logs_windows.outputs.file }}
40 changes: 11 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,18 @@ jobs:
run: |
echo "file=build/distributions/test_logs.tbz2" >> $GITHUB_OUTPUT
./gradlew tarTestLogs
- name: Upload crash logs (Unix)
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()
- name: Copy test logs
id: copy_test_logs
if: failure()
run: |
echo "file=build/distributions/test_logs.tbz2" | Out-File $env:GITHUB_OUTPUT -Encoding utf8 -Append
${{ 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 (Windows)
if: runner.os == 'Windows' && always() && steps.copy_test_logs_windows.outputs.file == 'build/distributions/test_logs.tbz2'
- 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_windows.outputs.file }}
path: ${{ steps.copy_test_logs.outputs.file }}

ea-build:
name: Java ${{ matrix.java }} (${{ matrix.os }})
Expand Down Expand Up @@ -147,27 +141,15 @@ 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-ea-${{ 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-ea-${{ matrix.os }}-java-${{ matrix.java }}
path: ${{ steps.copy_test_logs_windows.outputs.file }}

0 comments on commit 77780a4

Please sign in to comment.