Skip to content

Commit 30747cf

Browse files
authored
[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
1 parent e5f3260 commit 30747cf

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.ci/compute_projects.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"clang": {"clang-tools-extra", "compiler-rt", "cross-project-tests"},
5353
"clang-tools-extra": {"libc"},
5454
"mlir": {"flang"},
55+
# Test everything if ci scripts are changed.
56+
# FIXME: Figure out what is missing and add here.
57+
".ci": {"llvm", "clang", "lld", "lldb"},
5558
}
5659

5760
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
@@ -130,12 +133,11 @@ def _add_dependencies(projects: Set[str]) -> Set[str]:
130133
def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set[str]:
131134
projects_to_test = set()
132135
for modified_project in modified_projects:
133-
# Skip all projects where we cannot run tests.
134-
if modified_project not in PROJECT_CHECK_TARGETS:
135-
continue
136136
if modified_project in RUNTIMES:
137137
continue
138-
projects_to_test.add(modified_project)
138+
# Skip all projects where we cannot run tests.
139+
if modified_project in PROJECT_CHECK_TARGETS:
140+
projects_to_test.add(modified_project)
139141
if modified_project not in DEPENDENTS_TO_TEST:
140142
continue
141143
for dependent_project in DEPENDENTS_TO_TEST[modified_project]:

.ci/compute_projects_test.py

+17
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ def test_exclude_gn(self):
188188
self.assertEqual(env_variables["runtimes_to_build"], "")
189189
self.assertEqual(env_variables["runtimes_check_targets"], "")
190190

191+
def test_ci(self):
192+
env_variables = compute_projects.get_env_variables(
193+
[".ci/compute_projects.py"], "Linux"
194+
)
195+
self.assertEqual(env_variables["projects_to_build"], "clang;lld;llvm;lldb")
196+
self.assertEqual(
197+
env_variables["project_check_targets"],
198+
"check-clang check-lld check-llvm check-lldb",
199+
)
200+
self.assertEqual(
201+
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
202+
)
203+
self.assertEqual(
204+
env_variables["runtimes_check_targets"],
205+
"check-cxx check-cxxabi check-unwind",
206+
)
207+
191208

192209
if __name__ == "__main__":
193210
unittest.main()

0 commit comments

Comments
 (0)