Skip to content

Commit 1b03dff

Browse files
vaadin-botsissbrueckerclaude
authored
chore: make result job fail when any previous job fails (#9455) (CP: 25.2) (#9472)
This PR cherry-picks changes from the original PR #9455 to branch 25.2. --- #### Original PR description > The results job only failed on test failures captured in report XMLs. It did not fail when any previous job failed, for example the build, or when a test job runs into an error that didn't produce failed tests. > > This changes the result step to run unconditionally and fail on any job's failure/canceled result, so it can serve as the single required check. Renamed the job to "Validation result" to reflect the broader responsibility. > > This change was triggered by the discussion in this PR: #9448. There the required checks on "Unit tests", "Package WAR", etc. prevented the PR from merging, as with `[skip ci]` those jobs are never actually run due to `fast-tests` being skipped and never spawning them. As such it seems useful to have a single result job as required check that reports success for all previous jobs and test results. Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4118571 commit 1b03dff

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/validation.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ jobs:
498498
if-no-files-found: ignore
499499

500500
results:
501-
name: Collect tests
501+
name: Validation result
502502
needs: [build, fast-tests, its]
503-
if: always() && needs.build.result == 'success'
503+
if: always()
504504
runs-on: ubuntu-latest
505505
permissions:
506506
contents: read
@@ -668,10 +668,16 @@ jobs:
668668
gh api -X DELETE "repos/$GH_REPO/actions/artifacts/$id" || true
669669
done
670670
671-
- name: Fail if any test failed
671+
- name: Fail if any job or test failed
672672
if: always()
673673
run: |
674674
failed=false
675+
# Job-level failures (build/setup/compile/packaging/infra).
676+
# Skipped is OK: skip-ci skips fast-tests/its, empty builds skip its.
677+
for r in "${{ needs.build.result }}" "${{ needs.fast-tests.result }}" "${{ needs.its.result }}"; do
678+
[[ "$r" == "failure" || "$r" == "cancelled" ]] && failed=true
679+
done
680+
# Actual test failures captured in the published reports.
675681
[[ "${{ steps.unit-dorny.outputs.conclusion }}" == "failure" ]] && failed=true
676682
[[ "${{ steps.wtr-dorny.outputs.conclusion }}" == "failure" ]] && failed=true
677683
[[ "${{ steps.it-dorny.outputs.conclusion }}" == "failure" ]] && failed=true

0 commit comments

Comments
 (0)