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
This commit is contained in:
Shu Chen 2022-01-14 04:44:14 +00:00
commit 87b026779b
4 changed files with 154 additions and 2 deletions

View File

@ -275,6 +275,13 @@ build_examples_cmake_esp32c3:
variables: variables:
IDF_TARGET: esp32c3 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: .build_test_apps_template:
extends: .build_examples_cmake_template extends: .build_examples_cmake_template
variables: variables:

View File

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

View File

@ -284,6 +284,9 @@
.if-label-component_ut_esp32c3: &if-label-component_ut_esp32c3 .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: '$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-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' 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-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: '$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-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' 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-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: '$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-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' 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-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: '$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-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' 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 - <<: *if-dev-push
changes: *patterns-component_ut 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:build:component_ut-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -507,6 +536,21 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-custom_test 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:build:custom_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -597,6 +641,23 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-example_test 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:build:example_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -682,18 +743,21 @@
- <<: *if-label-component_ut - <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32 - <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3 - <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-component_ut_esp32s2 - <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3 - <<: *if-label-component_ut_esp32s3
- <<: *if-label-component_ut_esp8684 - <<: *if-label-component_ut_esp8684
- <<: *if-label-custom_test - <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32 - <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3 - <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3 - <<: *if-label-custom_test_esp32s3
- <<: *if-label-custom_test_esp8684 - <<: *if-label-custom_test_esp8684
- <<: *if-label-example_test - <<: *if-label-example_test
- <<: *if-label-example_test_esp32 - <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32c3 - <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32h2
- <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3 - <<: *if-label-example_test_esp32s3
- <<: *if-label-example_test_esp8684 - <<: *if-label-example_test_esp8684
@ -702,6 +766,7 @@
- <<: *if-label-unit_test - <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32 - <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3 - <<: *if-label-unit_test_esp32s3
- <<: *if-label-unit_test_esp8684 - <<: *if-label-unit_test_esp8684
@ -753,6 +818,21 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-unit_test 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:build:unit_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -845,18 +925,21 @@
- <<: *if-label-component_ut - <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32 - <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3 - <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-component_ut_esp32s2 - <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3 - <<: *if-label-component_ut_esp32s3
- <<: *if-label-component_ut_esp8684 - <<: *if-label-component_ut_esp8684
- <<: *if-label-custom_test - <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32 - <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3 - <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3 - <<: *if-label-custom_test_esp32s3
- <<: *if-label-custom_test_esp8684 - <<: *if-label-custom_test_esp8684
- <<: *if-label-example_test - <<: *if-label-example_test
- <<: *if-label-example_test_esp32 - <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32c3 - <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32h2
- <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3 - <<: *if-label-example_test_esp32s3
- <<: *if-label-example_test_esp8684 - <<: *if-label-example_test_esp8684
@ -866,6 +949,7 @@
- <<: *if-label-unit_test - <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32 - <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3 - <<: *if-label-unit_test_esp32s3
- <<: *if-label-unit_test_esp8684 - <<: *if-label-unit_test_esp8684
@ -913,6 +997,20 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-component_ut 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:test:component_ut-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -979,6 +1077,18 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-custom_test 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:test:custom_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -1043,6 +1153,20 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-example_test 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:test:example_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch
@ -1128,18 +1252,21 @@
- <<: *if-label-component_ut - <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32 - <<: *if-label-component_ut_esp32
- <<: *if-label-component_ut_esp32c3 - <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-component_ut_esp32s2 - <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3 - <<: *if-label-component_ut_esp32s3
- <<: *if-label-component_ut_esp8684 - <<: *if-label-component_ut_esp8684
- <<: *if-label-custom_test - <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32 - <<: *if-label-custom_test_esp32
- <<: *if-label-custom_test_esp32c3 - <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3 - <<: *if-label-custom_test_esp32s3
- <<: *if-label-custom_test_esp8684 - <<: *if-label-custom_test_esp8684
- <<: *if-label-example_test - <<: *if-label-example_test
- <<: *if-label-example_test_esp32 - <<: *if-label-example_test_esp32
- <<: *if-label-example_test_esp32c3 - <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32h2
- <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3 - <<: *if-label-example_test_esp32s3
- <<: *if-label-example_test_esp8684 - <<: *if-label-example_test_esp8684
@ -1147,6 +1274,7 @@
- <<: *if-label-unit_test - <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32 - <<: *if-label-unit_test_esp32
- <<: *if-label-unit_test_esp32c3 - <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3 - <<: *if-label-unit_test_esp32s3
- <<: *if-label-unit_test_esp8684 - <<: *if-label-unit_test_esp8684
@ -1187,6 +1315,18 @@
- <<: *if-dev-push - <<: *if-dev-push
changes: *patterns-unit_test 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:test:unit_test-esp32s2:
rules: rules:
- <<: *if-revert-branch - <<: *if-revert-branch

View File

@ -300,6 +300,10 @@ class BuildSystem:
'Linux': 'linux', '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 @classmethod
def build_prepare(cls, build_item): def build_prepare(cls, build_item):
app_path = build_item.app_dir app_path = build_item.app_dir
@ -417,10 +421,10 @@ class BuildSystem:
def _supported_targets(cls, app_path): def _supported_targets(cls, app_path):
readme_file_content = BuildSystem._read_readme(app_path) readme_file_content = BuildSystem._read_readme(app_path)
if not readme_file_content: 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) match = re.findall(BuildSystem.SUPPORTED_TARGETS_REGEX, readme_file_content)
if not match: 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: if len(match) > 1:
raise NotImplementedError("Can't determine the value of SUPPORTED_TARGETS in {}".format(app_path)) raise NotImplementedError("Can't determine the value of SUPPORTED_TARGETS in {}".format(app_path))
support_str = match[0].strip() support_str = match[0].strip()