Skip to content

Commit b10f7d8

Browse files
committed
Add unified allBuildAndTestSuccessful check to CI workflows
Add a new job `allBuildAndTestSuccessful` to both pull_request.yml and master.yml that depends on all other build and test jobs. This provides a single unified status check that can be used as a required check in branch protection rules to verify the entire build is green. https://claude.ai/code/session_01353Dv2D47pHrj45ExnLxmc
1 parent 471b676 commit b10f7d8

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/master.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,34 @@ jobs:
188188
distribution: 'corretto'
189189
- name: Verify Javadoc
190190
run: ./gradlew javadoc --info --stacktrace
191+
allBuildAndTestSuccessful:
192+
if: always()
193+
needs:
194+
- buildAndTest
195+
- update-baseline
196+
- javadoc
197+
- publishToMavenCentral
198+
runs-on: ubuntu-latest
199+
steps:
200+
- name: Verify all jobs passed
201+
run: |
202+
if [ "${{ needs.buildAndTest.result }}" != "success" ]; then
203+
echo "buildAndTest failed with result: ${{ needs.buildAndTest.result }}"
204+
exit 1
205+
fi
206+
if [ "${{ needs.update-baseline.result }}" != "success" ]; then
207+
echo "update-baseline failed with result: ${{ needs.update-baseline.result }}"
208+
exit 1
209+
fi
210+
if [ "${{ needs.javadoc.result }}" != "success" ]; then
211+
echo "javadoc failed with result: ${{ needs.javadoc.result }}"
212+
exit 1
213+
fi
214+
if [ "${{ needs.publishToMavenCentral.result }}" != "success" ]; then
215+
echo "publishToMavenCentral failed with result: ${{ needs.publishToMavenCentral.result }}"
216+
exit 1
217+
fi
218+
echo "All build and test jobs passed successfully."
191219
publishToMavenCentral:
192220
needs: buildAndTest
193221
runs-on: ubuntu-latest

.github/workflows/pull_request.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,26 @@ jobs:
396396
distribution: 'corretto'
397397
- name: Verify Javadoc
398398
run: ./gradlew javadoc --info --stacktrace
399+
allBuildAndTestSuccessful:
400+
if: always()
401+
needs:
402+
- buildAndTest
403+
- test-summary
404+
- javadoc
405+
runs-on: ubuntu-latest
406+
steps:
407+
- name: Verify all jobs passed
408+
run: |
409+
if [ "${{ needs.buildAndTest.result }}" != "success" ]; then
410+
echo "buildAndTest failed with result: ${{ needs.buildAndTest.result }}"
411+
exit 1
412+
fi
413+
if [ "${{ needs.test-summary.result }}" != "success" ] && [ "${{ needs.test-summary.result }}" != "skipped" ]; then
414+
echo "test-summary failed with result: ${{ needs.test-summary.result }}"
415+
exit 1
416+
fi
417+
if [ "${{ needs.javadoc.result }}" != "success" ]; then
418+
echo "javadoc failed with result: ${{ needs.javadoc.result }}"
419+
exit 1
420+
fi
421+
echo "All build and test jobs passed successfully."

0 commit comments

Comments
 (0)