[ci] add all projects as dependencies of ci (#136153)

Add all projects as dependencies of .ci, to make sure everything is
tested when it changes.

Originally split-off from #135499
This commit is contained in:
Matheus Izvekov 2025-04-18 17:42:29 -03:00 committed by GitHub
parent e5f326044f
commit 30747cfe41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 4 deletions

View File

@ -52,6 +52,9 @@ DEPENDENTS_TO_TEST = {
"clang": {"clang-tools-extra", "compiler-rt", "cross-project-tests"},
"clang-tools-extra": {"libc"},
"mlir": {"flang"},
# Test everything if ci scripts are changed.
# FIXME: Figure out what is missing and add here.
".ci": {"llvm", "clang", "lld", "lldb"},
}
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
@ -130,12 +133,11 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
projects_to_test = set()
for modified_project in modified_projects:
# Skip all projects where we cannot run tests.
if modified_project not in PROJECT_CHECK_TARGETS:
continue
if modified_project in RUNTIMES:
continue
projects_to_test.add(modified_project)
# Skip all projects where we cannot run tests.
if modified_project in PROJECT_CHECK_TARGETS:
projects_to_test.add(modified_project)
if modified_project not in DEPENDENTS_TO_TEST:
continue
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:

View File

@ -188,6 +188,23 @@ class TestComputeProjects(unittest.TestCase):
self.assertEqual(env_variables["runtimes_to_build"], "")
self.assertEqual(env_variables["runtimes_check_targets"], "")
def test_ci(self):
env_variables = compute_projects.get_env_variables(
[".ci/compute_projects.py"], "Linux"
)
self.assertEqual(env_variables["projects_to_build"], "clang;lld;llvm;lldb")
self.assertEqual(
env_variables["project_check_targets"],
"check-clang check-lld check-llvm check-lldb",
)
self.assertEqual(
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
)
self.assertEqual(
env_variables["runtimes_check_targets"],
"check-cxx check-cxxabi check-unwind",
)
if __name__ == "__main__":
unittest.main()