Skip to content

Commit

Permalink
Collect and process failures from individual matrix jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
fwendland committed Apr 5, 2024
1 parent a1157b6 commit 891cbd7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,34 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and Test
id: build-and-test
run: ./gradlew build --parallel
- if: ${{ failure() }}
run: touch failure
- if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.java-lts }}-failure
path: failure
if-no-files-found: ignore
retention-days: 1

process-failures:
if: ${{ !cancelled() }}
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Get failures from matrix jobs
uses: actions/download-artifact@v4
with:
path: all-failures
pattern: '*-failure'
merge-multiple: true
- name: Process failures
id: process-failures
run: test -f all-failures/failure && echo 'hasFails=true' >> "$GITHUB_OUTPUT"
- if: ${{ steps.process-failures.outputs.hasFails == 'true' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Some matrix jobs failed.')

0 comments on commit 891cbd7

Please sign in to comment.