diff --git a/.github/workflows/ci-low-cadence.yml b/.github/workflows/ci-low-cadence.yml index e9fd30e9..3669a2e3 100644 --- a/.github/workflows/ci-low-cadence.yml +++ b/.github/workflows/ci-low-cadence.yml @@ -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 }}) @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c07982e6..77fa688c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}) @@ -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 }}