Pārlūkot izejas kodu

Merge branch 'ci/esp32h2_ci_example_build' into 'master'

CI: Enable ESP32H2 example build test on CI (Zigbee&Thread test)

See merge request espressif/esp-idf!16736
Shu Chen 4 gadi atpakaļ
vecāks
revīzija
87b026779b

+ 7 - 0
.gitlab/ci/build.yml

@@ -275,6 +275,13 @@ build_examples_cmake_esp32c3:
   variables:
     IDF_TARGET: esp32c3
 
+build_examples_cmake_esp32h2:
+  extends:
+    - .build_examples_cmake_template
+    - .rules:build:example_test-esp32h2
+  variables:
+    IDF_TARGET: esp32h2
+
 .build_test_apps_template:
   extends: .build_examples_cmake_template
   variables:

+ 1 - 0
.gitlab/ci/dependencies/dependencies.yml

@@ -3,6 +3,7 @@
   - esp32s2
   - esp32s3
   - esp32c3
+  - esp32h2
   - esp8684
 
 .target_test: &target_test

+ 140 - 0
.gitlab/ci/rules.yml

@@ -284,6 +284,9 @@
 .if-label-component_ut_esp32c3: &if-label-component_ut_esp32c3
   if: '$BOT_LABEL_COMPONENT_UT_ESP32C3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32c3(?:,[^,\n\r]+)*$/i'
 
+.if-label-component_ut_esp32h2: &if-label-component_ut_esp32h2
+  if: '$BOT_LABEL_COMPONENT_UT_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32h2(?:,[^,\n\r]+)*$/i'
+
 .if-label-component_ut_esp32s2: &if-label-component_ut_esp32s2
   if: '$BOT_LABEL_COMPONENT_UT_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32s2(?:,[^,\n\r]+)*$/i'
 
@@ -302,6 +305,9 @@
 .if-label-custom_test_esp32c3: &if-label-custom_test_esp32c3
   if: '$BOT_LABEL_CUSTOM_TEST_ESP32C3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32c3(?:,[^,\n\r]+)*$/i'
 
+.if-label-custom_test_esp32h2: &if-label-custom_test_esp32h2
+  if: '$BOT_LABEL_CUSTOM_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32h2(?:,[^,\n\r]+)*$/i'
+
 .if-label-custom_test_esp32s2: &if-label-custom_test_esp32s2
   if: '$BOT_LABEL_CUSTOM_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32s2(?:,[^,\n\r]+)*$/i'
 
@@ -323,6 +329,9 @@
 .if-label-example_test_esp32c3: &if-label-example_test_esp32c3
   if: '$BOT_LABEL_EXAMPLE_TEST_ESP32C3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32c3(?:,[^,\n\r]+)*$/i'
 
+.if-label-example_test_esp32h2: &if-label-example_test_esp32h2
+  if: '$BOT_LABEL_EXAMPLE_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32h2(?:,[^,\n\r]+)*$/i'
+
 .if-label-example_test_esp32s2: &if-label-example_test_esp32s2
   if: '$BOT_LABEL_EXAMPLE_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32s2(?:,[^,\n\r]+)*$/i'
 
@@ -365,6 +374,9 @@
 .if-label-unit_test_esp32c3: &if-label-unit_test_esp32c3
   if: '$BOT_LABEL_UNIT_TEST_ESP32C3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32c3(?:,[^,\n\r]+)*$/i'
 
+.if-label-unit_test_esp32h2: &if-label-unit_test_esp32h2
+  if: '$BOT_LABEL_UNIT_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32h2(?:,[^,\n\r]+)*$/i'
+
 .if-label-unit_test_esp32s2: &if-label-unit_test_esp32s2
   if: '$BOT_LABEL_UNIT_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32s2(?:,[^,\n\r]+)*$/i'
 
@@ -425,6 +437,23 @@
     - <<: *if-dev-push
       changes: *patterns-component_ut
 
+.rules:build:component_ut-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build
+    - <<: *if-label-component_ut
+    - <<: *if-label-component_ut_esp32h2
+    - <<: *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-component_ut
+
 .rules:build:component_ut-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -507,6 +536,21 @@
     - <<: *if-dev-push
       changes: *patterns-custom_test
 
+.rules:build:custom_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build
+    - <<: *if-label-custom_test
+    - <<: *if-label-custom_test_esp32h2
+    - <<: *if-dev-push
+      changes: *patterns-build_components
+    - <<: *if-dev-push
+      changes: *patterns-build_system
+    - <<: *if-dev-push
+      changes: *patterns-custom_test
+
 .rules:build:custom_test-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -597,6 +641,23 @@
     - <<: *if-dev-push
       changes: *patterns-example_test
 
+.rules:build:example_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build
+    - <<: *if-label-example_test
+    - <<: *if-label-example_test_esp32h2
+    - <<: *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-example_test
+
 .rules:build:example_test-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -682,18 +743,21 @@
     - <<: *if-label-component_ut
     - <<: *if-label-component_ut_esp32
     - <<: *if-label-component_ut_esp32c3
+    - <<: *if-label-component_ut_esp32h2
     - <<: *if-label-component_ut_esp32s2
     - <<: *if-label-component_ut_esp32s3
     - <<: *if-label-component_ut_esp8684
     - <<: *if-label-custom_test
     - <<: *if-label-custom_test_esp32
     - <<: *if-label-custom_test_esp32c3
+    - <<: *if-label-custom_test_esp32h2
     - <<: *if-label-custom_test_esp32s2
     - <<: *if-label-custom_test_esp32s3
     - <<: *if-label-custom_test_esp8684
     - <<: *if-label-example_test
     - <<: *if-label-example_test_esp32
     - <<: *if-label-example_test_esp32c3
+    - <<: *if-label-example_test_esp32h2
     - <<: *if-label-example_test_esp32s2
     - <<: *if-label-example_test_esp32s3
     - <<: *if-label-example_test_esp8684
@@ -702,6 +766,7 @@
     - <<: *if-label-unit_test
     - <<: *if-label-unit_test_esp32
     - <<: *if-label-unit_test_esp32c3
+    - <<: *if-label-unit_test_esp32h2
     - <<: *if-label-unit_test_esp32s2
     - <<: *if-label-unit_test_esp32s3
     - <<: *if-label-unit_test_esp8684
@@ -753,6 +818,21 @@
     - <<: *if-dev-push
       changes: *patterns-unit_test
 
+.rules:build:unit_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build
+    - <<: *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-unit_test
+
 .rules:build:unit_test-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -845,18 +925,21 @@
     - <<: *if-label-component_ut
     - <<: *if-label-component_ut_esp32
     - <<: *if-label-component_ut_esp32c3
+    - <<: *if-label-component_ut_esp32h2
     - <<: *if-label-component_ut_esp32s2
     - <<: *if-label-component_ut_esp32s3
     - <<: *if-label-component_ut_esp8684
     - <<: *if-label-custom_test
     - <<: *if-label-custom_test_esp32
     - <<: *if-label-custom_test_esp32c3
+    - <<: *if-label-custom_test_esp32h2
     - <<: *if-label-custom_test_esp32s2
     - <<: *if-label-custom_test_esp32s3
     - <<: *if-label-custom_test_esp8684
     - <<: *if-label-example_test
     - <<: *if-label-example_test_esp32
     - <<: *if-label-example_test_esp32c3
+    - <<: *if-label-example_test_esp32h2
     - <<: *if-label-example_test_esp32s2
     - <<: *if-label-example_test_esp32s3
     - <<: *if-label-example_test_esp8684
@@ -866,6 +949,7 @@
     - <<: *if-label-unit_test
     - <<: *if-label-unit_test_esp32
     - <<: *if-label-unit_test_esp32c3
+    - <<: *if-label-unit_test_esp32h2
     - <<: *if-label-unit_test_esp32s2
     - <<: *if-label-unit_test_esp32s3
     - <<: *if-label-unit_test_esp8684
@@ -913,6 +997,20 @@
     - <<: *if-dev-push
       changes: *patterns-component_ut
 
+.rules:test:component_ut-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build-only
+      when: never
+    - <<: *if-label-component_ut
+    - <<: *if-label-component_ut_esp32h2
+    - <<: *if-label-unit_test
+    - <<: *if-label-unit_test_esp32h2
+    - <<: *if-dev-push
+      changes: *patterns-component_ut
+
 .rules:test:component_ut-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -979,6 +1077,18 @@
     - <<: *if-dev-push
       changes: *patterns-custom_test
 
+.rules:test:custom_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build-only
+      when: never
+    - <<: *if-label-custom_test
+    - <<: *if-label-custom_test_esp32h2
+    - <<: *if-dev-push
+      changes: *patterns-custom_test
+
 .rules:test:custom_test-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -1043,6 +1153,20 @@
     - <<: *if-dev-push
       changes: *patterns-example_test
 
+.rules:test:example_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build-only
+      when: never
+    - <<: *if-label-example_test
+    - <<: *if-label-example_test_esp32h2
+    - <<: *if-dev-push
+      changes: *patterns-build-example_test
+    - <<: *if-dev-push
+      changes: *patterns-example_test
+
 .rules:test:example_test-esp32s2:
   rules:
     - <<: *if-revert-branch
@@ -1128,18 +1252,21 @@
     - <<: *if-label-component_ut
     - <<: *if-label-component_ut_esp32
     - <<: *if-label-component_ut_esp32c3
+    - <<: *if-label-component_ut_esp32h2
     - <<: *if-label-component_ut_esp32s2
     - <<: *if-label-component_ut_esp32s3
     - <<: *if-label-component_ut_esp8684
     - <<: *if-label-custom_test
     - <<: *if-label-custom_test_esp32
     - <<: *if-label-custom_test_esp32c3
+    - <<: *if-label-custom_test_esp32h2
     - <<: *if-label-custom_test_esp32s2
     - <<: *if-label-custom_test_esp32s3
     - <<: *if-label-custom_test_esp8684
     - <<: *if-label-example_test
     - <<: *if-label-example_test_esp32
     - <<: *if-label-example_test_esp32c3
+    - <<: *if-label-example_test_esp32h2
     - <<: *if-label-example_test_esp32s2
     - <<: *if-label-example_test_esp32s3
     - <<: *if-label-example_test_esp8684
@@ -1147,6 +1274,7 @@
     - <<: *if-label-unit_test
     - <<: *if-label-unit_test_esp32
     - <<: *if-label-unit_test_esp32c3
+    - <<: *if-label-unit_test_esp32h2
     - <<: *if-label-unit_test_esp32s2
     - <<: *if-label-unit_test_esp32s3
     - <<: *if-label-unit_test_esp8684
@@ -1187,6 +1315,18 @@
     - <<: *if-dev-push
       changes: *patterns-unit_test
 
+.rules:test:unit_test-esp32h2:
+  rules:
+    - <<: *if-revert-branch
+      when: never
+    - <<: *if-protected
+    - <<: *if-label-build-only
+      when: never
+    - <<: *if-label-unit_test
+    - <<: *if-label-unit_test_esp32h2
+    - <<: *if-dev-push
+      changes: *patterns-unit_test
+
 .rules:test:unit_test-esp32s2:
   rules:
     - <<: *if-revert-branch

+ 6 - 2
tools/find_build_apps/common.py

@@ -300,6 +300,10 @@ class BuildSystem:
         'Linux': 'linux',
     }
 
+    # ESP32H2-TODO: IDF-4559
+    # Build only apps who has ESP32-H2 in the README.md supported targets table.
+    DEFAULT_TARGETS = ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp8684', 'linux']
+
     @classmethod
     def build_prepare(cls, build_item):
         app_path = build_item.app_dir
@@ -417,10 +421,10 @@ class BuildSystem:
     def _supported_targets(cls, app_path):
         readme_file_content = BuildSystem._read_readme(app_path)
         if not readme_file_content:
-            return cls.FORMAL_TO_USUAL.values()  # supports all targets if no readme found
+            return cls.DEFAULT_TARGETS  # supports all default targets if no readme found
         match = re.findall(BuildSystem.SUPPORTED_TARGETS_REGEX, readme_file_content)
         if not match:
-            return cls.FORMAL_TO_USUAL.values()  # supports all targets if no such header in readme
+            return cls.DEFAULT_TARGETS  # supports all default targets if no such header in readme
         if len(match) > 1:
             raise NotImplementedError("Can't determine the value of SUPPORTED_TARGETS in {}".format(app_path))
         support_str = match[0].strip()