CI: apply schema-validation to the example config files
- Any config file with a schema gets a test (validate-<module>) to test the file.
This commit is contained in:
parent
deec0b862f
commit
b48c2745c1
@ -66,3 +66,21 @@ endforeach()
|
|||||||
|
|
||||||
include( CalamaresAddTranslations )
|
include( CalamaresAddTranslations )
|
||||||
add_calamares_python_translations( ${CALAMARES_TRANSLATION_LANGUAGES} )
|
add_calamares_python_translations( ${CALAMARES_TRANSLATION_LANGUAGES} )
|
||||||
|
|
||||||
|
# TODO:3.3: Use FindPython3
|
||||||
|
if ( BUILD_TESTING AND PYTHONINTERP_FOUND AND PYTHON_EXECUTABLE )
|
||||||
|
# The tests for each config file are independent of whether the
|
||||||
|
# module is enabled or not: the config file should match its schema
|
||||||
|
# regardless.
|
||||||
|
foreach( SUBDIRECTORY ${SUBDIRECTORIES} )
|
||||||
|
set( _schema_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.schema.yaml" )
|
||||||
|
set( _conf_file "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${SUBDIRECTORY}.conf" )
|
||||||
|
if ( EXISTS "${_schema_file}" AND EXISTS "${_conf_file}" )
|
||||||
|
add_test(
|
||||||
|
NAME validate-${SUBDIRECTORY}
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" "${_schema_file}" "${_conf_file}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user