Skip to content

Commit

Permalink
[CI] Simplify log upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko authored and DarrylGamroth committed Jan 22, 2025
1 parent 848c14b commit 4c66f71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 35 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/ci-low-cadence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,18 @@ jobs:
run: ./gradlew slowTest
env:
BUILD_JAVA_VERSION: ${{ matrix.java }}
- 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 }}

java-javadoc:
name: JavaDoc (JDK ${{ matrix.java }}, ${{ matrix.os }})
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION (Linux/MacOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION (Unix)
if: runner.os != 'Windows'
run: |
java -Xinternalversion
echo "BUILD_JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV
Expand Down Expand Up @@ -106,30 +106,18 @@ jobs:
- name: Remove small temp file system (Windows)
if: always() && runner.os == 'Windows'
run: Remove-Partition -DriveLetter T -Confirm:$false
- 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 }}

java-topology-build:
name: Java Topology Tests (JDK ${{ matrix.java }}, ${{ matrix.os }})
Expand Down Expand Up @@ -184,7 +172,7 @@ jobs:
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
if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2'
Expand Down

0 comments on commit 4c66f71

Please sign in to comment.