Skip to content

Commit 08e7c17

Browse files
[CI] Test All Projects On Workflow Changes
This patch makes it so that we actually run all the tests when we touch the workflow file in .github/workflows/premerge.yaml. Before this we would not run any tests and it was annoying to have to manually touch a file to get something to trigger. Reviewers: Keenuts, lnihlen, cmtice, dschuff, gburgessiv Reviewed By: gburgessiv Pull Request: #150250
1 parent b5c8795 commit 08e7c17

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.ci/compute_projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
("clang", "include", "clang", "CIR"): "CIR",
155155
("*", "docs"): "docs",
156156
("llvm", "utils", "gn"): "gn",
157+
(".github", "workflows", "premerge.yaml"): ".ci",
157158
}
158159

159160
# Projects that should not run any tests. These need to be metaprojects.

.ci/compute_projects_test.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,41 @@ def test_clang_tools_extra(self):
308308
self.assertEqual(env_variables["runtimes_check_targets"], "check-libc")
309309
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
310310

311+
def test_premerge_workflow(self):
312+
env_variables = compute_projects.get_env_variables(
313+
[".github/workflows/premerge.yaml"], "Linux"
314+
)
315+
self.assertEqual(
316+
env_variables["projects_to_build"],
317+
"bolt;clang;clang-tools-extra;flang;libclc;lld;lldb;llvm;mlir;polly",
318+
)
319+
self.assertEqual(
320+
env_variables["project_check_targets"],
321+
"check-bolt check-clang check-clang-cir check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
322+
)
323+
self.assertEqual(
324+
env_variables["runtimes_to_build"],
325+
"compiler-rt;libc;libcxx;libcxxabi;libunwind",
326+
)
327+
self.assertEqual(
328+
env_variables["runtimes_check_targets"],
329+
"check-compiler-rt check-libc",
330+
)
331+
self.assertEqual(
332+
env_variables["runtimes_check_targets_needs_reconfig"],
333+
"check-cxx check-cxxabi check-unwind",
334+
)
335+
336+
def test_other_github_workflow(self):
337+
env_variables = compute_projects.get_env_variables(
338+
[".github/workflows/docs.yml"], "Linux"
339+
)
340+
self.assertEqual(env_variables["projects_to_build"], "")
341+
self.assertEqual(env_variables["project_check_targets"], "")
342+
self.assertEqual(env_variables["runtimes_to_build"], "")
343+
self.assertEqual(env_variables["runtimes_check_targets"], "")
344+
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
345+
311346

312347
if __name__ == "__main__":
313348
unittest.main()

0 commit comments

Comments
 (0)