From 44c0faed434d9f5ebbf8b6b9dd06c9a7e539b304 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Tue, 17 Sep 2024 08:59:48 +0200 Subject: [PATCH] ci: add manual job to make sure soc caps are parsed seamlessly --- .gitlab/ci/host-test.yml | 18 ++++++++++++++++++ .gitlab/ci/rules.yml | 4 ++++ tools/ci/exclude_check_tools_files.txt | 1 + tools/ci/idf_build_apps_dump_soc_caps.py | 16 ++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 tools/ci/idf_build_apps_dump_soc_caps.py diff --git a/.gitlab/ci/host-test.yml b/.gitlab/ci/host-test.yml index 1e2657ea6c..c646f0c235 100644 --- a/.gitlab/ci/host-test.yml +++ b/.gitlab/ci/host-test.yml @@ -402,3 +402,21 @@ test_nvs_gen_check: script: - cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool - pytest --noconftest test_nvs_gen_check.py --junitxml=XUNIT_RESULT.xml + +make_sure_soc_caps_compatible_in_idf_build_apps: + extends: + - .host_test_template + - .rules:dev-push + artifacts: + paths: + - new.json + - base.json + when: always + when: manual + script: + - python tools/ci/idf_build_apps_dump_soc_caps.py new.json + - git fetch --depth=1 origin $CI_MERGE_REQUEST_DIFF_BASE_SHA + - git checkout -f $CI_MERGE_REQUEST_DIFF_BASE_SHA + - git checkout $CI_COMMIT_SHA -- tools/ci/idf_build_apps_dump_soc_caps.py + - python tools/ci/idf_build_apps_dump_soc_caps.py base.json + - diff new.json base.json diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index d16fbbc9c3..cc386ac506 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -225,6 +225,10 @@ rules: - <<: *if-tag-release +.rules:dev-push: + rules: + - <<: *if-dev-push + # Do not upload caches on dev branches by default .rules:upload-python-cache: rules: diff --git a/tools/ci/exclude_check_tools_files.txt b/tools/ci/exclude_check_tools_files.txt index 1bc83c8b68..6454124619 100644 --- a/tools/ci/exclude_check_tools_files.txt +++ b/tools/ci/exclude_check_tools_files.txt @@ -58,3 +58,4 @@ tools/legacy_exports/export_legacy.fish tools/legacy_exports/export_legacy.sh tools/legacy_exports/export_legacy.ps1 tools/legacy_exports/export_legacy.bat +tools/ci/idf_build_apps_dump_soc_caps.py diff --git a/tools/ci/idf_build_apps_dump_soc_caps.py b/tools/ci/idf_build_apps_dump_soc_caps.py new file mode 100644 index 0000000000..568ec10ee2 --- /dev/null +++ b/tools/ci/idf_build_apps_dump_soc_caps.py @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import json +from argparse import ArgumentParser + +from idf_build_apps.constants import ALL_TARGETS +from idf_build_apps.manifest.soc_header import SocHeader + +if __name__ == '__main__': + parser = ArgumentParser(description='Dump parsed SOC headers for all supported targets') + parser.add_argument('output', help='Output file') + args = parser.parse_args() + + d = {target: SocHeader(target) for target in ALL_TARGETS} + with open(args.output, 'w') as f: + json.dump(d, f, indent=2)