Skip to content

Commit 367a465

Browse files
committed
Add a build verdict job that depends on all others
Update the required job to always run and list any failed required workflows.
1 parent b91213c commit 367a465

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,33 @@ jobs:
128128
shell_check_enabled: false
129129
yamllint_check_enabled: false
130130
python_lint_check_enabled: false
131+
132+
build-verdict:
133+
name: Build Verdict
134+
needs:
135+
- tests_with_docker_embedded_swift
136+
- tests_with_docker
137+
- tests_without_docker
138+
- tests_macos
139+
- build_tests_ios
140+
- soundness
141+
- proposal_validation
142+
- soundness-docs
143+
runs-on: ubuntu-latest
144+
if: always() # Runs even if previous jobs fail so it can evaluate them
145+
steps:
146+
- name: Install required tools
147+
run: |
148+
sudo apt-get update
149+
sudo apt-get install -y --no-install-recommends coreutils jq
150+
- name: Check upstream job statuses
151+
env:
152+
NEEDS_JSON: ${{ toJSON(needs) }}
153+
run: |
154+
failed=$(printf '%s' "$NEEDS_JSON" | jq -r 'to_entries | map(select(.value.result != "success")) | .[] | "\(.key): \(.value.result)"')
155+
if [ -n "$failed" ]; then
156+
echo "The following required jobs did not succeed:"
157+
printf '%s\n' "$failed"
158+
exit 1
159+
fi
160+
echo "All required jobs passed successfully!"

0 commit comments

Comments
 (0)