File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,3 +128,40 @@ jobs:
128128 needs : changes
129129 if : ${{ needs.changes.outputs.docs == 'true' || github.event_name == 'workflow_dispatch' }}
130130 uses : ./.github/workflows/generate-docs.yml
131+
132+ required :
133+ name : Required Checks
134+ runs-on : ubuntu-latest
135+ needs :
136+ - builds
137+ - tests
138+ - license-check
139+ - pin-check
140+ - cpp-checks
141+ - generate-docs
142+ if : always()
143+ steps :
144+ - name : Verify required CI jobs
145+ shell : bash
146+ env :
147+ NEEDS_JSON : ${{ toJson(needs) }}
148+ run : |
149+ python3 - <<'PY'
150+ import json
151+ import os
152+ import sys
153+
154+ needs = json.loads(os.environ["NEEDS_JSON"])
155+ failed = {
156+ name: data["result"]
157+ for name, data in needs.items()
158+ if data["result"] not in ("success", "skipped")
159+ }
160+
161+ if failed:
162+ for name, result in failed.items():
163+ print(f"::error::{name} finished with result={result}")
164+ sys.exit(1)
165+
166+ print("All required CI jobs succeeded or were skipped by path filters.")
167+ PY
You can’t perform that action at this time.
0 commit comments