21
21
GITHUB_DEFAULT_BRANCH = os .environ ["GITHUB_DEFAULT_BRANCH" ]
22
22
GITHUB_CODEOWNERS_PATH = Path (".github/CODEOWNERS" )
23
23
GITHUB_WORKFLOWS_PATH = Path (".github/workflows" )
24
+
24
25
CONFIGURATION_FILE_NAMES = frozenset ({
25
26
".pre-commit-config.yaml" ,
26
27
".ruff.toml" ,
27
28
"mypy.ini" ,
28
29
})
30
+ UNIX_BUILD_SYSTEM_FILE_NAMES = frozenset ({
31
+ Path ("aclocal.m4" ),
32
+ Path ("config.guess" ),
33
+ Path ("config.sub" ),
34
+ Path ("configure" ),
35
+ Path ("configure.ac" ),
36
+ Path ("install-sh" ),
37
+ Path ("Makefile.pre.in" ),
38
+ Path ("Modules/makesetup" ),
39
+ Path ("Modules/Setup" ),
40
+ Path ("Modules/Setup.bootstrap.in" ),
41
+ Path ("Modules/Setup.stdlib.in" ),
42
+ Path ("Tools/build/regen-configure.sh" ),
43
+ })
44
+
29
45
SUFFIXES_C_OR_CPP = frozenset ({".c" , ".h" , ".cpp" })
30
46
SUFFIXES_DOCUMENTATION = frozenset ({".rst" , ".md" })
31
47
@@ -36,6 +52,7 @@ class Outputs:
36
52
run_docs : bool = False
37
53
run_tests : bool = False
38
54
run_windows_msi : bool = False
55
+ run_windows_tests : bool = False
39
56
40
57
41
58
def compute_changes () -> None :
@@ -53,6 +70,8 @@ def compute_changes() -> None:
53
70
54
71
if outputs .run_tests :
55
72
print ("Run tests" )
73
+ if outputs .run_windows_tests :
74
+ print ("Run Windows tests" )
56
75
57
76
if outputs .run_ci_fuzz :
58
77
print ("Run CIFuzz tests" )
@@ -98,6 +117,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
98
117
run_tests = False
99
118
run_ci_fuzz = False
100
119
run_docs = False
120
+ run_windows_tests = False
101
121
run_windows_msi = False
102
122
103
123
for file in changed_files :
@@ -120,6 +140,9 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
120
140
):
121
141
run_tests = True
122
142
143
+ if file not in UNIX_BUILD_SYSTEM_FILE_NAMES :
144
+ run_windows_tests = True
145
+
123
146
# The fuzz tests are pretty slow so they are executed only for PRs
124
147
# changing relevant files.
125
148
if file .suffix in SUFFIXES_C_OR_CPP :
@@ -142,6 +165,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
142
165
run_ci_fuzz = run_ci_fuzz ,
143
166
run_docs = run_docs ,
144
167
run_tests = run_tests ,
168
+ run_windows_tests = run_windows_tests ,
145
169
run_windows_msi = run_windows_msi ,
146
170
)
147
171
@@ -172,6 +196,7 @@ def write_github_output(outputs: Outputs) -> None:
172
196
f .write (f"run-ci-fuzz={ bool_lower (outputs .run_ci_fuzz )} \n " )
173
197
f .write (f"run-docs={ bool_lower (outputs .run_docs )} \n " )
174
198
f .write (f"run-tests={ bool_lower (outputs .run_tests )} \n " )
199
+ f .write (f"run-windows-tests={ bool_lower (outputs .run_windows_tests )} \n " )
175
200
f .write (f"run-windows-msi={ bool_lower (outputs .run_windows_msi )} \n " )
176
201
177
202
0 commit comments