Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
12 changes: 9 additions & 3 deletions .github/scripts/tests/therock_configure_ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ def test_is_path_workflow_file_related_to_ci(self):
self.assertTrue(
therock_configure_ci.is_path_workflow_file_related_to_ci(script_path)
)
ci_env_path = ".github/actions/ci-env/action.yml"
self.assertTrue(
therock_configure_ci.is_path_workflow_file_related_to_ci(ci_env_path)
)
bad_path = ".github/workflows/test.yml"
self.assertFalse(
therock_configure_ci.is_path_workflow_file_related_to_ci(bad_path)
)
bad_action_path = ".github/actions/setup-rocm-linux/action.yml"
self.assertFalse(
therock_configure_ci.is_path_workflow_file_related_to_ci(bad_action_path)
)

def test_is_path_skippable(self):
# Skippable paths
Expand Down Expand Up @@ -349,9 +357,7 @@ def test_retrieve_projects_nightly_ignores_labels(self, mock_get_modified):
# Test labels only apply to pull requests, not nightly runs
mock_get_modified.return_value = []

pr_labels_json = (
'{"labels": [{"name": "test:rocblas"}, {"name": "test_type:comprehensive"}]}'
)
pr_labels_json = '{"labels": [{"name": "test:rocblas"}, {"name": "test_type:comprehensive"}]}'
projects, test_type = therock_configure_ci.retrieve_projects(
{"is_nightly": True, "base_ref": "HEAD^", "pr_labels": pr_labels_json}
)
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/therock_configure_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,14 @@ def check_for_non_skippable_path(paths: Optional[Iterable[str]]) -> bool:
THEROCK_CI_PATTERNS = [
".github/workflows/therock*",
".github/scripts/therock*",
".github/actions/ci-env/action.yml",
]
Comment thread
tony-davis marked this conversation as resolved.
Resolved


def is_path_workflow_file_related_to_ci(path: str) -> bool:
return any(fnmatch.fnmatch(path, pattern) for pattern in THEROCK_CI_PATTERNS)


def check_for_workflow_file_related_to_ci(paths: Optional[Iterable[str]]) -> bool:
if paths is None:
return False
Expand Down
Loading