From 6b1a846678047e4284c259843db233c9dbc3b3a4 Mon Sep 17 00:00:00 2001 From: Chen Yudong Date: Wed, 15 Nov 2023 13:43:16 +0800 Subject: [PATCH] ci: add build unit test apps jobs --- .gitlab/ci/build.yml | 85 +++++++++++++++++ .gitlab/ci/rules.yml | 211 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 296 insertions(+) diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 8ad53e0480..d4272ebeb2 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -451,6 +451,91 @@ fast_template_app: variables: BUILD_COMMAND_ARGS: "-p" #------------------------------------------------------------------------------ +.build_esp_idf_tests_cmake_template: + extends: + - .build_cmake_template + - .before_script_build_jobs + artifacts: + paths: + - "**/build*/size.json" + - "**/build*/build_log.txt" + - "**/build*/*.bin" + # upload to s3 server to save the artifacts size + # - "**/build*/*.map" + # ttfw tests require elf files + - "**/build*/*.elf" + - "**/build*/flasher_args.json" + - "**/build*/flash_project_args" + - "**/build*/config/sdkconfig.json" + - "**/build*/sdkconfig" + - "**/build*/bootloader/*.bin" + - "**/build*/partition_table/*.bin" + - list_job_*.json + - size_info.txt + - components/idf_test/unit_test/*.yml + when: always + expire_in: 4 days + script: + # CI specific options start from "--collect-size-info xxx". could ignore when running locally + - run_cmd python tools/ci/ci_build_apps.py tools/unit-test-app -v + -t $IDF_TARGET + --config "configs/*=" + --copy-sdkconfig + --preserve-all + --collect-size-info size_info.txt + --collect-app-info list_job_${CI_NODE_INDEX:-1}.json + --parallel-count ${CI_NODE_TOTAL:-1} + --parallel-index ${CI_NODE_INDEX:-1} + - run_cmd python tools/unit-test-app/tools/UnitTestParser.py tools/unit-test-app ${CI_NODE_INDEX:-1} + +build_esp_idf_tests_cmake_esp32: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32 + variables: + IDF_TARGET: esp32 + +build_esp_idf_tests_cmake_esp32s2: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32s2 + variables: + IDF_TARGET: esp32s2 + +build_esp_idf_tests_cmake_esp32s3: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32s3 + variables: + IDF_TARGET: esp32s3 + +build_esp_idf_tests_cmake_esp32c2: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32c2 + variables: + IDF_TARGET: esp32c2 + +build_esp_idf_tests_cmake_esp32c3: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32c3 + variables: + IDF_TARGET: esp32c3 + +build_esp_idf_tests_cmake_esp32c6: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32c6 + variables: + IDF_TARGET: esp32c6 + +build_esp_idf_tests_cmake_esp32h2: + extends: + - .build_esp_idf_tests_cmake_template + - .rules:build:unit_test-esp32h2 + variables: + IDF_TARGET: esp32h2 build_examples_cmake_esp32: extends: diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 795d8e4dc6..be02549a57 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -1587,6 +1587,217 @@ - <<: *if-dev-push changes: *patterns-unit_test-sdio +.rules:build:unit_test-esp32: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-lan8720 + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32c2: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32c2 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32c3: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32c3 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32c6: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32c6 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32h2: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32h2 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32s2: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32s2 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + +.rules:build:unit_test-esp32s3: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32s3 + - <<: *if-dev-push + changes: *patterns-build_components + - <<: *if-dev-push + changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-downloadable-tools + - <<: *if-dev-push + changes: *patterns-target_test-adc + - <<: *if-dev-push + changes: *patterns-target_test-ecdsa + - <<: *if-dev-push + changes: *patterns-target_test-i154 + - <<: *if-dev-push + changes: *patterns-target_test-wifi + - <<: *if-dev-push + changes: *patterns-unit_test + - <<: *if-dev-push + changes: *patterns-unit_test-flash_multi + - <<: *if-dev-push + changes: *patterns-unit_test-sdio + .rules:labels-protected:lan8720: rules: - <<: *if-revert-branch