Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,3 +887,28 @@ jobs:
- name: Construct a loopback configuration without a request
run: |
"$RUNNER_TEMP/model-runtime-venv/bin/python" -I scripts/run_without_sockets.py scripts/smoke_model_runtime.py

required-ci:
name: Required CI
if: ${{ always() }}
needs:
- test
- quality
- coverage
- shadow-benchmark-evidence
- capture-benchmark-contracts
- connectors
- capture-platform-contract
- build
- artifact-only-atif
- artifact-only-connectors
- installed-core-wheel
- installed-sdist
- installed-model-runtime
runs-on: ubuntu-24.04
timeout-minutes: 5
env:
CI_RESULTS: ${{ toJSON(needs) }}
steps:
- name: Require every CI job to succeed
run: jq -e 'all(.[]; .result == "success")' <<< "$CI_RESULTS"
19 changes: 19 additions & 0 deletions tests/test_ci_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,25 @@ def test_ci_keeps_the_installed_model_runtime_smoke_config_only() -> None:
assert "/chat/completions" not in runtime


def test_ci_exposes_one_fail_closed_required_gate() -> None:
text = _read(".github/workflows/ci.yml")
gate = _job_block(text, "required-ci")

assert text.count("name: Required CI") == 1
assert "if: ${{ always() }}" in gate
assert "runs-on: ubuntu-24.04" in gate
assert "timeout-minutes: 5" in gate
assert "CI_RESULTS: ${{ toJSON(needs) }}" in gate
assert 'run: jq -e \'all(.[]; .result == "success")\' <<< "$CI_RESULTS"' in gate

needs = re.search(r"(?ms)^ needs:\n(?P<body>.*?)(?=^ [a-z-]+:)", gate)
assert needs is not None
needed_jobs = re.findall(r"(?m)^ - ([a-z][a-z-]+)$", needs.group("body"))
declared_jobs = re.findall(r"(?m)^ ([a-z0-9][a-z0-9-]*):$", text.partition("jobs:\n")[2])
assert declared_jobs[-1] == "required-ci"
assert needed_jobs == declared_jobs[:-1]


def test_ci_installed_jobs_share_only_the_built_distributions() -> None:
text = _read(".github/workflows/ci.yml")
installed = tuple(
Expand Down
Loading