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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
permissions:
pull-requests: read
outputs:
full_ci: ${{ github.event_name != 'pull_request' || (!startsWith(github.event.pull_request.title, 'docs') && steps.filter.outputs.full_ci == 'true') }}
full_ci: ${{ github.event_name != 'pull_request' || steps.filter.outputs.full_ci == 'true' }}
steps:
- name: Detect non-documentation changes
id: filter
if: github.event_name == 'pull_request' && !startsWith(github.event.pull_request.title, 'docs')
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@v4
with:
predicate-quantifier: every
Expand Down
31 changes: 31 additions & 0 deletions tests/test_ci_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Regression checks for the primary CI workflow."""

import asyncio
from pathlib import Path
from typing import Any

import yaml


async def test_full_ci_depends_on_changed_paths_not_pr_title() -> None:
"""Ensure a docs-prefixed title cannot bypass substantive CI jobs."""
workflow_path = Path(__file__).resolve().parents[1] / ".github" / "workflows" / "ci.yml"
workflow_text = await asyncio.to_thread(workflow_path.read_text)
workflow: dict[str, Any] = await asyncio.to_thread(
yaml.load,
workflow_text,
Loader=yaml.BaseLoader,
)
changes = workflow["jobs"]["changes"]

full_ci = changes["outputs"]["full_ci"]
assert "pull_request.title" not in full_ci
assert "github.event_name != 'pull_request'" in full_ci
assert "steps.filter.outputs.full_ci == 'true'" in full_ci

filter_step = next(step for step in changes["steps"] if step.get("id") == "filter")
assert "pull_request.title" not in filter_step["if"]
assert filter_step["if"] == "github.event_name == 'pull_request'"
Loading