Skip to content

Commit bde8531

Browse files
vdemeestertekton-robot
authored andcommitted
Add CI summary fan-in job to presubmit CI
Add a ci-summary job that depends on all CI jobs and acts as a single required check for branch protection. This replaces having to configure individual job names as required checks. The job treats both 'success' and 'skipped' as passing states, only failing when a job returns 'failure' or 'cancelled'. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
1 parent db16aff commit bde8531

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,39 @@ jobs:
108108
e2e-tests:
109109
needs: [build]
110110
uses: ./.github/workflows/e2e-matrix.yml
111+
112+
ci-summary:
113+
name: CI summary
114+
if: always()
115+
needs:
116+
- build
117+
- linting
118+
- tests
119+
- generated
120+
- multi-arch-build
121+
- e2e-tests
122+
runs-on: ubuntu-latest
123+
steps:
124+
- name: Check job results
125+
run: |
126+
echo "build: ${{ needs.build.result }}"
127+
echo "linting: ${{ needs.linting.result }}"
128+
echo "tests: ${{ needs.tests.result }}"
129+
echo "generated: ${{ needs.generated.result }}"
130+
echo "multi-arch-build: ${{ needs.multi-arch-build.result }}"
131+
echo "e2e-tests: ${{ needs.e2e-tests.result }}"
132+
results=(
133+
"${{ needs.build.result }}"
134+
"${{ needs.linting.result }}"
135+
"${{ needs.tests.result }}"
136+
"${{ needs.generated.result }}"
137+
"${{ needs.multi-arch-build.result }}"
138+
"${{ needs.e2e-tests.result }}"
139+
)
140+
for result in "${results[@]}"; do
141+
if [[ "$result" != "success" && "$result" != "skipped" ]]; then
142+
echo "One or more jobs failed"
143+
exit 1
144+
fi
145+
done
146+
echo "All jobs passed or were skipped"

0 commit comments

Comments
 (0)