diff --git a/.gitlab/ci/assign-test.yml b/.gitlab/ci/assign-test.yml index f697c3d23c..d3e92d440f 100644 --- a/.gitlab/ci/assign-test.yml +++ b/.gitlab/ci/assign-test.yml @@ -25,6 +25,9 @@ assign_example_test: - job: build_examples_cmake_esp32s2 artifacts: false optional: true + - job: build_examples_cmake_esp32c2 + artifacts: false + optional: true - job: build_examples_cmake_esp32c3 artifacts: false optional: true @@ -47,6 +50,9 @@ assign_custom_test: - job: build_test_apps_esp32s2 artifacts: false optional: true + - job: build_test_apps_esp32c2 + artifacts: false + optional: true - job: build_test_apps_esp32c3 artifacts: false optional: true @@ -67,6 +73,8 @@ assign_unit_test: optional: true - job: build_esp_idf_tests_cmake_esp32s2 optional: true + - job: build_esp_idf_tests_cmake_esp32c2 + optional: true - job: build_esp_idf_tests_cmake_esp32c3 optional: true - job: build_esp_idf_tests_cmake_esp32s3 diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index 1341a172fe..ffadba23f4 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -59,13 +59,6 @@ build_pytest_examples_esp32s3: script: - run_cmd python tools/ci/build_pytest_apps.py examples --target esp32s3 --size-info $SIZE_INFO_LOCATION -vv -build_pytest_examples_esp32c3: - extends: - - .build_pytest_template - - .rules:build:example_test-esp32c3 - script: - - run_cmd python tools/ci/build_pytest_apps.py examples --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv - build_pytest_examples_esp32c2: extends: - .build_pytest_template @@ -73,6 +66,13 @@ build_pytest_examples_esp32c2: script: - run_cmd python tools/ci/build_pytest_apps.py examples --target esp32c2 --size-info $SIZE_INFO_LOCATION -vv +build_pytest_examples_esp32c3: + extends: + - .build_pytest_template + - .rules:build:example_test-esp32c3 + script: + - run_cmd python tools/ci/build_pytest_apps.py examples --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv + build_pytest_components_esp32: extends: - .build_pytest_template @@ -139,6 +139,13 @@ build_pytest_test_apps_esp32s3: script: - run_cmd python tools/ci/build_pytest_apps.py tools/test_apps --target esp32s3 --size-info $SIZE_INFO_LOCATION -vv +build_pytest_test_apps_esp32c2: + extends: + - .build_pytest_template + - .rules:build:custom_test-esp32c2 + script: + - run_cmd python tools/ci/build_pytest_apps.py tools/test_apps --target esp32c2 --size-info $SIZE_INFO_LOCATION -vv + build_pytest_test_apps_esp32c3: extends: - .build_pytest_template @@ -282,13 +289,6 @@ build_esp_idf_tests_cmake_esp32s3: variables: IDF_TARGET: esp32s3 -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_esp32c2: extends: - .build_esp_idf_tests_cmake_template @@ -296,6 +296,13 @@ build_esp_idf_tests_cmake_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_examples_template: extends: .build_template dependencies: # set dependencies to null to avoid missing artifacts issue @@ -362,6 +369,14 @@ build_examples_cmake_esp32s3: variables: IDF_TARGET: esp32s3 +build_examples_cmake_esp32c2: + extends: + - .build_examples_cmake_template + - .rules:build:example_test-esp32c2 + parallel: 8 + variables: + IDF_TARGET: esp32c2 + build_examples_cmake_esp32c3: extends: - .build_examples_cmake_template diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index a8601518a8..3e7a1e890d 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -156,6 +156,27 @@ build:integration_test: - "build:component_ut-{0}" - build:target_test +# due to the lack of runners, c2 tests will only be triggered by label +"test:{0}-esp32c2": + matrix: + - *target_test + labels: + - "{0}_esp32c2" + included_in: + - "build:{0}" + - "build:{0}-esp32c2" + - build:target_test + +# overwrite the esp32c2 component ut again +"test:component_ut-esp32c2": # component_ut will trigger by unit_test as well, since now we have 2 kinds of UT + labels: + - "component_ut_esp32c2" + - "unit_test_esp32c2" + included_in: + - build:component_ut + - "build:component_ut-esp32c2" + - build:target_test + # due to the lack of runners, s3 tests will only be triggered by label "test:{0}-esp32s3": matrix: diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index b11e5a9928..f87b6c218d 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -483,10 +483,7 @@ when: never - <<: *if-protected - <<: *if-label-build - - <<: *if-label-component_ut - <<: *if-label-component_ut_esp32c2 - - <<: *if-label-target_test - - <<: *if-label-unit_test - <<: *if-label-unit_test_esp32c2 - <<: *if-dev-push changes: *patterns-build_components @@ -494,8 +491,6 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-build_target_test - - <<: *if-dev-push - changes: *patterns-component_ut .rules:build:component_ut-esp32c3: rules: @@ -628,17 +623,13 @@ when: never - <<: *if-protected - <<: *if-label-build - - <<: *if-label-custom_test - <<: *if-label-custom_test_esp32c2 - - <<: *if-label-target_test - <<: *if-dev-push changes: *patterns-build_components - <<: *if-dev-push changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-build_target_test - - <<: *if-dev-push - changes: *patterns-custom_test .rules:build:custom_test-esp32c3: rules: @@ -775,19 +766,13 @@ when: never - <<: *if-protected - <<: *if-label-build - - <<: *if-label-example_test - <<: *if-label-example_test_esp32c2 - - <<: *if-label-target_test - - <<: *if-dev-push - changes: *patterns-build-example_test - <<: *if-dev-push changes: *patterns-build_components - <<: *if-dev-push changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-build_target_test - - <<: *if-dev-push - changes: *patterns-example_test .rules:build:example_test-esp32c3: rules: @@ -1002,8 +987,6 @@ 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 @@ -1011,8 +994,6 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-build_target_test - - <<: *if-dev-push - changes: *patterns-unit_test .rules:build:unit_test-esp32c3: rules: @@ -1152,13 +1133,8 @@ - <<: *if-protected - <<: *if-label-build-only when: never - - <<: *if-label-component_ut - <<: *if-label-component_ut_esp32c2 - - <<: *if-label-target_test - - <<: *if-label-unit_test - <<: *if-label-unit_test_esp32c2 - - <<: *if-dev-push - changes: *patterns-component_ut .rules:test:component_ut-esp32c3: rules: @@ -1235,11 +1211,7 @@ - <<: *if-protected - <<: *if-label-build-only when: never - - <<: *if-label-custom_test - <<: *if-label-custom_test_esp32c2 - - <<: *if-label-target_test - - <<: *if-dev-push - changes: *patterns-custom_test .rules:test:custom_test-esp32c3: rules: @@ -1311,13 +1283,7 @@ - <<: *if-protected - <<: *if-label-build-only when: never - - <<: *if-label-example_test - <<: *if-label-example_test_esp32c2 - - <<: *if-label-target_test - - <<: *if-dev-push - changes: *patterns-build-example_test - - <<: *if-dev-push - changes: *patterns-example_test .rules:test:example_test-esp32c3: rules: @@ -1427,11 +1393,7 @@ - <<: *if-protected - <<: *if-label-build-only when: never - - <<: *if-label-target_test - - <<: *if-label-unit_test - <<: *if-label-unit_test_esp32c2 - - <<: *if-dev-push - changes: *patterns-unit_test .rules:test:unit_test-esp32c3: rules: diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 501e036fc4..46a04fa652 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -61,6 +61,16 @@ example_test_pytest_esp32s3_generic: TARGET: ESP32S3 ENV_MARKER: generic +example_test_pytest_esp32c2_generic: + extends: + - .pytest_examples_dir_template + - .rules:test:example_test-esp32c2 + needs: + - build_pytest_examples_esp32c2 + variables: + TARGET: ESP32C2 + ENV_MARKER: generic + example_test_pytest_esp32c3_generic: extends: - .pytest_examples_dir_template @@ -256,6 +266,16 @@ component_ut_pytest_esp32s3_octal_psram: TARGET: ESP32S3 ENV_MARKER: octal_psram +component_ut_pytest_esp32c2_generic: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32c2 + needs: + - build_pytest_components_esp32c2 + variables: + TARGET: ESP32C2 + ENV_MARKER: generic + component_ut_pytest_esp32c3_generic: extends: - .pytest_components_dir_template @@ -303,6 +323,16 @@ test_app_test_pytest_esp32s3_generic: TARGET: ESP32S3 ENV_MARKER: generic +test_app_test_pytest_esp32c2_generic: + extends: + - .pytest_test_apps_dir_template + - .rules:test:custom_test-esp32c2 + needs: + - build_pytest_test_apps_esp32c2 + variables: + TARGET: ESP32C2 + ENV_MARKER: generic + test_app_test_pytest_esp32c3_generic: extends: - .pytest_test_apps_dir_template @@ -401,6 +431,11 @@ test_weekend_mqtt: - .example_test_template - .rules:test:example_test-esp32s2 +.example_test_esp32c2_template: + extends: + - .example_test_template + - .rules:test:example_test-esp32c2 + .example_test_esp32c3_template: extends: - .example_test_template @@ -572,6 +607,13 @@ example_test_017: - ESP32S2 - Example_GENERIC +example_test_C2_GENERIC: + extends: .example_test_esp32c2_template + parallel: 2 + tags: + - ESP32C2 + - Example_GENERIC + example_test_C3_GENERIC: extends: .example_test_esp32c3_template parallel: 2 @@ -621,6 +663,11 @@ example_test_ESP32C3_SDSPI: - .test_app_template - .rules:test:custom_test-esp32s2 +.test_app_esp32c2_template: + extends: + - .test_app_template + - .rules:test:custom_test-esp32c2 + .test_app_esp32c3_template: extends: - .test_app_template @@ -663,6 +710,12 @@ test_app_test_004: - ESP32S2 - Example_GENERIC +test_app_test_esp32c2_generic: + extends: .test_app_esp32c2_template + tags: + - ESP32C2 + - Example_GENERIC + test_app_test_005: extends: .test_app_esp32c3_template tags: @@ -716,6 +769,11 @@ test_app_test_flash_psram_f8r8: - .unit_test_template - .rules:test:unit_test-esp32s3 +.unit_test_esp32c2_template: + extends: + - .unit_test_template + - .rules:test:unit_test-esp32c2 + .unit_test_esp32c3_template: extends: - .unit_test_template @@ -767,7 +825,7 @@ UT_006: UT_007: extends: .unit_test_esp32_template - parallel: 5 + parallel: 2 tags: - ESP32_IDF - UT_T1_1 @@ -904,7 +962,7 @@ UT_046: UT_047: extends: .unit_test_esp32s2_template - parallel: 13 + parallel: 5 tags: - ESP32S2_IDF - UT_T1_1 @@ -921,9 +979,16 @@ UT_S2_SDSPI: - ESP32S2_IDF - UT_T1_SPIMODE +UT_C2: + extends: .unit_test_esp32c2_template + parallel: 19 + tags: + - ESP32C2_IDF + - UT_T1_1 + UT_C3: extends: .unit_test_esp32c3_template - parallel: 34 + parallel: 31 tags: - ESP32C3_IDF - UT_T1_1 @@ -967,27 +1032,19 @@ UT_C3_SDSPI: UT_S3: extends: .unit_test_esp32s3_template - parallel: 33 + parallel: 28 tags: - ESP32S3_IDF - UT_T1_1 UT_S3_QUAD_PSRAM: extends: .unit_test_esp32s3_template - parallel: 33 + parallel: 4 tags: - ESP32S3_IDF - UT_T1_1 - quad_psram -UT_S3_OCTAL_PSRAM: - extends: .unit_test_esp32s3_template - parallel: 33 - tags: - - ESP32S3_IDF - - UT_T1_1 - - octal_psram - UT_S3_SPI_DUAL: extends: .unit_test_esp32s3_template tags: diff --git a/tools/ci/python_packages/ttfw_idf/IDFAssignTest.py b/tools/ci/python_packages/ttfw_idf/IDFAssignTest.py index 89218931b3..83d0baccf7 100644 --- a/tools/ci/python_packages/ttfw_idf/IDFAssignTest.py +++ b/tools/ci/python_packages/ttfw_idf/IDFAssignTest.py @@ -126,6 +126,7 @@ class UnitTestGroup(IDFCaseGroup): 'esp32': 'ESP32DUT', 'esp32s2': 'ESP32S2DUT', 'esp32s3': 'ESP32S3DUT', + 'esp32c2': 'ESP32C2DUT', 'esp32c3': 'ESP32C3DUT', 'esp8266': 'ESP8266DUT', } diff --git a/tools/ci/python_packages/ttfw_idf/IDFDUT.py b/tools/ci/python_packages/ttfw_idf/IDFDUT.py index 89fb2429d6..f3d69becc1 100644 --- a/tools/ci/python_packages/ttfw_idf/IDFDUT.py +++ b/tools/ci/python_packages/ttfw_idf/IDFDUT.py @@ -604,6 +604,15 @@ class ESP32S3DUT(IDFDUT): raise NotImplementedError() +class ESP32C2DUT(IDFDUT): + TARGET = 'esp32c2' + TOOLCHAIN_PREFIX = 'riscv32-esp-elf-' + + @classmethod + def get_rom(cls): + return targets.ESP32C2ROM + + class ESP32C3DUT(IDFDUT): TARGET = 'esp32c3' TOOLCHAIN_PREFIX = 'riscv32-esp-elf-' @@ -641,7 +650,7 @@ class ESP8266DUT(IDFDUT): def get_target_by_rom_class(cls): - for c in [ESP32DUT, ESP32S2DUT, ESP32S3DUT, ESP32C3DUT, ESP32C6DUT, ESP32H2DUT, ESP8266DUT, IDFQEMUDUT]: + for c in [ESP32DUT, ESP32S2DUT, ESP32S3DUT, ESP32C2DUT, ESP32C3DUT, ESP32C6DUT, ESP32H2DUT, ESP8266DUT, IDFQEMUDUT]: if c.get_rom() == cls: return c.TARGET return None diff --git a/tools/ci/python_packages/ttfw_idf/__init__.py b/tools/ci/python_packages/ttfw_idf/__init__.py index 33ae4a434a..af5fae6f66 100644 --- a/tools/ci/python_packages/ttfw_idf/__init__.py +++ b/tools/ci/python_packages/ttfw_idf/__init__.py @@ -14,8 +14,8 @@ from tiny_test_fw import TinyFW, Utility from .DebugUtils import CustomProcess, GDBBackend, OCDBackend # noqa: export DebugUtils for users from .IDFApp import UT, ComponentUTApp, Example, IDFApp, LoadableElfTestApp, TestApp # noqa: export all Apps for users -from .IDFDUT import (ESP32C3DUT, ESP32C3FPGADUT, ESP32C6DUT, ESP32DUT, ESP32H2DUT, # noqa: export DUTs for users - ESP32QEMUDUT, ESP32S2DUT, ESP32S3DUT, ESP32S3FPGADUT, ESP8266DUT, IDFDUT) +from .IDFDUT import (ESP32C2DUT, ESP32C3DUT, ESP32C3FPGADUT, ESP32C6DUT, ESP32DUT, # noqa: export DUTs for users + ESP32H2DUT, ESP32QEMUDUT, ESP32S2DUT, ESP32S3DUT, ESP32S3FPGADUT, ESP8266DUT, IDFDUT) from .unity_test_parser import TestFormat, TestResults # pass TARGET_DUT_CLS_DICT to Env.py to avoid circular dependency issue. @@ -23,6 +23,7 @@ TARGET_DUT_CLS_DICT = { 'ESP32': ESP32DUT, 'ESP32S2': ESP32S2DUT, 'ESP32S3': ESP32S3DUT, + 'ESP32C2': ESP32C2DUT, 'ESP32C3': ESP32C3DUT, 'ESP32C3FPGA': ESP32C3FPGADUT, 'ESP32S3FPGA': ESP32S3FPGADUT, diff --git a/tools/unit-test-app/tools/ConfigDependency.yml b/tools/unit-test-app/tools/ConfigDependency.yml index 70961bbdd8..403ca4ad53 100644 --- a/tools/unit-test-app/tools/ConfigDependency.yml +++ b/tools/unit-test-app/tools/ConfigDependency.yml @@ -3,6 +3,7 @@ "ESP32_IDF": "CONFIG_IDF_TARGET_ESP32=y" "ESP32S2_IDF": "CONFIG_IDF_TARGET_ESP32S2=y" "ESP32S3_IDF": "CONFIG_IDF_TARGET_ESP32S3=y" +"ESP32C2_IDF": "CONFIG_IDF_TARGET_ESP32C2=y" "ESP32C3_IDF": "CONFIG_IDF_TARGET_ESP32C3=y" "quad_psram": '{CONFIG_SPIRAM_MODE_QUAD=y} and {CONFIG_IDF_TARGET_ESP32S3=y}' "octal_psram": '{CONFIG_SPIRAM_MODE_OCT=y} and {CONFIG_IDF_TARGET_ESP32S3=y}'