CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
71 lines
2.0 KiB
Python
71 lines
2.0 KiB
Python
"""
|
|
Determines which component CI jobs to run based on changed files.
|
|
|
|
Outputs boolean flags per component via GITHUB_OUTPUT:
|
|
- stinkytofu=true/false
|
|
- rocisa=true/false
|
|
|
|
Each component defines a set of path patterns. If any changed file matches,
|
|
that component is marked as triggered.
|
|
|
|
Usage:
|
|
python component_ci.py
|
|
"""
|
|
|
|
import os
|
|
|
|
from ci_utils import get_modified_paths, matches_paths, set_github_output
|
|
|
|
COMPONENTS = {
|
|
"stinkytofu": [
|
|
"shared/stinkytofu/**",
|
|
],
|
|
"rocisa": [
|
|
"projects/hipblaslt/tensilelite/rocisa/**",
|
|
"shared/stinkytofu/**",
|
|
],
|
|
"miopen": [
|
|
"projects/miopen/**",
|
|
".github/workflows/component-ci-miopen.yml",
|
|
],
|
|
}
|
|
|
|
# Paths that affect every component's CI run: the workflow, this script,
|
|
# and the shared ci-env action. A change here re-triggers all components.
|
|
INFRA_PATHS = [
|
|
".github/workflows/component-ci.yml",
|
|
".github/scripts/component_ci.py",
|
|
".github/actions/ci-env/**",
|
|
]
|
|
|
|
|
|
# detect_changed_components is not shared with therock_configure_ci.py because
|
|
# TheRock uses prefix-based subtree matching (via repos-config.json) while
|
|
# component CI uses fnmatch glob patterns with cross-component triggers
|
|
# (e.g. rocisa triggers when stinkytofu changes because it depends on it).
|
|
def detect_changed_components(changed_files: set[str]) -> dict[str, bool]:
|
|
results = {}
|
|
for key, patterns in COMPONENTS.items():
|
|
all_patterns = patterns + INFRA_PATHS
|
|
results[key] = matches_paths(changed_files, all_patterns)
|
|
return results
|
|
|
|
|
|
def main():
|
|
base_ref = os.environ.get("BASE_REF", "HEAD^")
|
|
is_workflow_dispatch = os.environ.get("GITHUB_EVENT_NAME") == "workflow_dispatch"
|
|
|
|
if is_workflow_dispatch:
|
|
changed = {key: True for key in COMPONENTS}
|
|
else:
|
|
changed_files = get_modified_paths(base_ref)
|
|
changed = detect_changed_components(changed_files)
|
|
|
|
print(f"Changed components: {changed}")
|
|
outputs = {k: str(v).lower() for k, v in changed.items()}
|
|
set_github_output(outputs)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|