Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Exclude docs directories from triggering rebuilds #133185

6 changes: 6 additions & 0 deletions .ci/compute_projects.py
Original file line number Diff line number Diff line change
@@ -194,6 +194,12 @@ def _compute_runtime_check_targets(runtimes_to_test: Set[str]) -> Set[str]:
def _get_modified_projects(modified_files: list[str]) -> Set[str]:
modified_projects = set()
for modified_file in modified_files:
path_parts = pathlib.Path(modified_file).parts
# Exclude files in the docs directory. They do not impact an test
# targets and there is a separate workflow used for ensuring the
# documentation builds.
if len(path_parts) > 2 and path_parts[1] == "docs":
continue
modified_projects.add(pathlib.Path(modified_file).parts[0])
return modified_projects

9 changes: 9 additions & 0 deletions .ci/compute_projects_test.py
Original file line number Diff line number Diff line change
@@ -170,6 +170,15 @@ def test_exclude_runtiems_in_projects(self):
self.assertEqual(env_variables["runtimes_to_build"], "")
self.assertEqual(env_variables["runtimes_check_targets"], "")

def test_exclude_docs(self):
env_variables = compute_projects.get_env_variables(
["llvm/docs/CIBestPractices.rst"], "Linux"
)
self.assertEqual(env_variables["projects_to_build"], "")
self.assertEqual(env_variables["project_check_targets"], "")
self.assertEqual(env_variables["runtimes_to_build"], "")
self.assertEqual(env_variables["runtimes_check_targets"], "")


if __name__ == "__main__":
unittest.main()
Loading
Oops, something went wrong.