2121GITHUB_DEFAULT_BRANCH = os .environ ["GITHUB_DEFAULT_BRANCH" ]
2222GITHUB_CODEOWNERS_PATH = Path (".github/CODEOWNERS" )
2323GITHUB_WORKFLOWS_PATH = Path (".github/workflows" )
24+
2425CONFIGURATION_FILE_NAMES = frozenset ({
2526 ".pre-commit-config.yaml" ,
2627 ".ruff.toml" ,
2728 "mypy.ini" ,
2829})
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+
2945SUFFIXES_C_OR_CPP = frozenset ({".c" , ".h" , ".cpp" })
3046SUFFIXES_DOCUMENTATION = frozenset ({".rst" , ".md" })
3147
@@ -36,6 +52,7 @@ class Outputs:
3652 run_docs : bool = False
3753 run_tests : bool = False
3854 run_windows_msi : bool = False
55+ run_windows_tests : bool = False
3956
4057
4158def compute_changes () -> None :
@@ -53,6 +70,8 @@ def compute_changes() -> None:
5370
5471 if outputs .run_tests :
5572 print ("Run tests" )
73+ if outputs .run_windows_tests :
74+ print ("Run Windows tests" )
5675
5776 if outputs .run_ci_fuzz :
5877 print ("Run CIFuzz tests" )
@@ -98,6 +117,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
98117 run_tests = False
99118 run_ci_fuzz = False
100119 run_docs = False
120+ run_windows_tests = False
101121 run_windows_msi = False
102122
103123 for file in changed_files :
@@ -120,6 +140,9 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
120140 ):
121141 run_tests = True
122142
143+ if file not in UNIX_BUILD_SYSTEM_FILE_NAMES :
144+ run_windows_tests = True
145+
123146 # The fuzz tests are pretty slow so they are executed only for PRs
124147 # changing relevant files.
125148 if file .suffix in SUFFIXES_C_OR_CPP :
@@ -142,6 +165,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
142165 run_ci_fuzz = run_ci_fuzz ,
143166 run_docs = run_docs ,
144167 run_tests = run_tests ,
168+ run_windows_tests = run_windows_tests ,
145169 run_windows_msi = run_windows_msi ,
146170 )
147171
@@ -172,6 +196,7 @@ def write_github_output(outputs: Outputs) -> None:
172196 f .write (f"run-ci-fuzz={ bool_lower (outputs .run_ci_fuzz )} \n " )
173197 f .write (f"run-docs={ bool_lower (outputs .run_docs )} \n " )
174198 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 " )
175200 f .write (f"run-windows-msi={ bool_lower (outputs .run_windows_msi )} \n " )
176201
177202
0 commit comments