@@ -908,18 +908,21 @@ def import_python_sources(args):
908
908
# add ci verification util
909
909
#
910
910
# ----------------------------------------------------------------------------------------------------------------------
911
- def verify_ci (dest_suite , common_dirs = None , args = None ):
911
+ def verify_ci (dest_suite , common_ci_dir = "ci_common" , args = None , ext = ( '.jsonnet' , '.libsonnet' ) ):
912
912
"""Verify CI configuration"""
913
- if common_dirs is None :
914
- common_dirs = ['ci_common' ]
915
913
base_suite = SUITE
916
914
if not isinstance (dest_suite , mx .SourceSuite ) or not isinstance (base_suite , mx .SourceSuite ):
917
915
raise mx .abort ("Can not use verify-ci on binary suites: {} and {} need to be source suites" .format (
918
916
SUITE .name , dest_suite .name ))
919
917
assert isinstance (base_suite , mx .SourceSuite )
920
- for ext in [".libsonnet" , ".jsonnet" ]:
921
- mx .log ("CI setup verifying *{} files ... " .format (ext ))
922
- mx .verify_ci (args , base_suite , dest_suite , common_dirs = common_dirs , extension = ext )
918
+
919
+ ci_files = [os .path .join (common_ci_dir , name )
920
+ for name in os .listdir (os .path .join (SUITE .dir , common_ci_dir ))
921
+ if os .path .splitext (name )[- 1 ] in ext ]
922
+
923
+ for common_file in ci_files :
924
+ mx .log ("CI setup verifying {} ... " .format (common_file ))
925
+ mx .verify_ci (args , base_suite , dest_suite , common_file = common_file )
923
926
924
927
925
928
# ----------------------------------------------------------------------------------------------------------------------
0 commit comments