Skip to content

Commit b348adf

Browse files
vdemeestertekton-robot
authored andcommitted
ci: add unified CI summary job
- Consolidate all CI jobs into a single fan-in check that accepts both "success" and "skipped" as passing states - Prevent docs-only or skipped-job PRs from falsely failing Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
1 parent 7b7814f commit b348adf

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,36 @@ jobs:
101101
EOF
102102
# Test that ko can resolve the config for multiple architectures
103103
KO_DOCKER_REPO=example.com ko resolve --platform=linux/amd64,linux/arm64 --push=false -R -f config 1>/dev/null
104-
echo "Ko resolve succeeded for multi-arch build."
104+
echo "Ko resolve succeeded for multi-arch build."
105+
106+
ci-summary:
107+
name: CI summary
108+
needs: [build, unit-tests, linting, check-licenses, ko-resolve]
109+
runs-on: ubuntu-latest
110+
if: always()
111+
steps:
112+
- name: Check CI results
113+
run: |
114+
results=(
115+
"build=${{ needs.build.result }}"
116+
"unit-tests=${{ needs.unit-tests.result }}"
117+
"linting=${{ needs.linting.result }}"
118+
"check-licenses=${{ needs.check-licenses.result }}"
119+
"ko-resolve=${{ needs.ko-resolve.result }}"
120+
)
121+
failed=0
122+
for r in "${results[@]}"; do
123+
name="${r%%=*}"
124+
result="${r#*=}"
125+
echo "${name}: ${result}"
126+
if [ "$result" != "success" ] && [ "$result" != "skipped" ]; then
127+
failed=1
128+
fi
129+
done
130+
if [ "$failed" -eq 1 ]; then
131+
echo ""
132+
echo "Some CI jobs failed or were cancelled"
133+
exit 1
134+
fi
135+
echo ""
136+
echo "All CI checks passed"

0 commit comments

Comments
 (0)