From 6acd57df023b1950a96a47b8a78216f9f9524b24 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Wed, 20 Mar 2024 10:03:48 +0100 Subject: [PATCH] ci: support trigger full pipeline by components --- .../scripts/generate_build_child_pipeline.py | 19 +++++++++++- tools/ci/idf_pytest/constants.py | 31 ++++++++++--------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py b/tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py index 9c77e83c7f..7c8bf1d4d1 100644 --- a/tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py +++ b/tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py @@ -22,6 +22,7 @@ from idf_ci.app import dump_apps_to_txt from idf_ci_utils import IDF_PATH from idf_pytest.constants import CollectMode from idf_pytest.constants import DEFAULT_CONFIG_RULES_STR +from idf_pytest.constants import DEFAULT_FULL_BUILD_TEST_COMPONENTS from idf_pytest.constants import DEFAULT_FULL_BUILD_TEST_FILEPATTERNS from idf_pytest.script import get_all_apps @@ -184,6 +185,18 @@ if __name__ == '__main__': 'If set to "", the value would be considered as None. ' 'If set to ";", the value would be considered as an empty list', ) + parser.add_argument( + '-ic', + '--ignore-app-dependencies-components', + type=_separate_str_to_list, + help='semicolon-separated string which specifies the modified components used for ' + 'ignoring checking the app dependencies. ' + 'The `depends_components` and `depends_filepatterns` set in the manifest files will be ignored ' + 'when any of the specified components matches any of the modified components. ' + 'Must be used together with --modified-components. ' + 'If set to "", the value would be considered as None. ' + 'If set to ";", the value would be considered as an empty list', + ) parser.add_argument( '-if', '--ignore-app-dependencies-filepatterns', @@ -216,7 +229,11 @@ if __name__ == '__main__': f'- modified files: {args.modified_files}' ) - if args.modified_files and not args.ignore_app_dependencies_filepatterns: + if args.modified_components is not None and not args.ignore_app_dependencies_components: + # setting default values + args.ignore_app_dependencies_components = DEFAULT_FULL_BUILD_TEST_COMPONENTS + + if args.modified_files is not None and not args.ignore_app_dependencies_filepatterns: # setting default values args.ignore_app_dependencies_filepatterns = DEFAULT_FULL_BUILD_TEST_FILEPATTERNS diff --git a/tools/ci/idf_pytest/constants.py b/tools/ci/idf_pytest/constants.py index 49b2426b27..4ff0687e54 100644 --- a/tools/ci/idf_pytest/constants.py +++ b/tools/ci/idf_pytest/constants.py @@ -122,27 +122,28 @@ ENV_MARKERS = { DEFAULT_CONFIG_RULES_STR = ['sdkconfig.ci=default', 'sdkconfig.ci.*=', '=default'] DEFAULT_IGNORE_WARNING_FILEPATH = os.path.join(IDF_PATH, 'tools', 'ci', 'ignore_build_warnings.txt') DEFAULT_BUILD_TEST_RULES_FILEPATH = os.path.join(IDF_PATH, '.gitlab', 'ci', 'default-build-test-rules.yml') +DEFAULT_FULL_BUILD_TEST_COMPONENTS = [ + 'cxx', + 'esp_common', + 'esp_hw_support', + 'esp_rom', + 'esp_system', + 'esp_timer', + 'freertos', + 'hal', + 'heap', + 'log', + 'newlib', + 'riscv', + 'soc', + 'xtensa', +] DEFAULT_FULL_BUILD_TEST_FILEPATTERNS = [ # tools 'tools/cmake/**/*', 'tools/tools.json', # ci 'tools/ci/ignore_build_warnings.txt', - # components - 'components/cxx/**/*', - 'components/esp_common/**/*', - 'components/esp_hw_support/**/*', - 'components/esp_rom/**/*', - 'components/esp_system/**/*', - 'components/esp_timer/**/*', - 'components/freertos/**/*', - 'components/hal/**/*', - 'components/heap/**/*', - 'components/log/**/*', - 'components/newlib/**/*', - 'components/riscv/**/*', - 'components/soc/**/*', - 'components/xtensa/**/*', ] DEFAULT_BUILD_LOG_FILENAME = 'build_log.txt'