Merge branch 'ci/run_build_jobs_when_files_under_components_changed' into 'master'

CI: run build jobs when files under components changed

See merge request espressif/esp-idf!12442
This commit is contained in:
Angus Gratton 2021-02-23 03:44:51 +00:00
commit 7fbf280d93
4 changed files with 186 additions and 98 deletions

View File

@ -44,7 +44,7 @@
fast_template_app:
extends:
- .build_template_app_template
- .rules:test:target_test
- .rules:build:target_test
stage: pre_check
variables:
BUILD_COMMAND_ARGS: "-p"

View File

@ -10,33 +10,35 @@
- unit_test
- component_ut
"build:{0}-{1}":
matrix:
- *target_test
- *all_targets
##############
# Build Jobs #
##############
"build":
labels:
- build
patterns:
- build
- build_components
- build_system
included_in:
- build:target_test
"build:example_test-esp32":
# -------------------
# Specific Build Jobs
# -------------------
"build:docker":
labels:
- build
- weekend_test # only have esp32 jobs
- iperf_stress_test # only have esp32 jobs
- docker
patterns:
- build
- example_test
- docker
"build:{0}":
matrix:
- [windows, docker]
"build:windows":
labels:
- build
- "{0}"
- windows
patterns:
- build
- "{0}"
- build_system
- windows
"build:macos":
labels:
@ -44,7 +46,7 @@
- macos
- macos_test # for backward compatibility
patterns:
- build
- build_system
- macos
"build:docs":
@ -63,29 +65,54 @@
deploy:
- preview
"build":
labels:
- build
patterns:
- build
"test:{0}-{1}":
# ---------------
# Build Test Jobs
# ---------------
"build:{0}-{1}":
matrix:
- *target_test
- *all_targets
labels:
- build
patterns:
- build_components
- build_system
# -------------
# Special Cases
# -------------
"build:example_test-esp32":
labels:
- build
- weekend_test # only have esp32 jobs
- iperf_stress_test # only have esp32 jobs
patterns:
- build_components
- build_system
####################
# Target Test Jobs #
####################
"test:{0}-{1}":
matrix:
- *target_test
- *all_targets
labels: # For each rule, use labels <test_type> and <test_type>-<target>
- "{0}"
- "{0}_{1}"
patterns:
patterns: # For each rule, use patterns <test_type> and build-<test_type>
- "{0}"
- build
- "build-{0}"
included_in:
included_in: # Parent rules
- "build:{0}-{1}"
- build:target_test
- test:target_test
- test:any_test
"test:component_ut-{0}":
# -------------
# Special Cases
# -------------
"test:component_ut-{0}": # component_ut will trigger by unit_test as well, since now we have 2 kinds of UT
matrix:
- *all_targets
labels:
@ -95,10 +122,10 @@
- "unit_test_{0}"
patterns:
- component_ut
- build
- "build-component_ut-{0}"
included_in:
- "build:component_ut-{0}"
- build:target_test
- test:target_test
- test:any_test
@ -107,8 +134,6 @@
labels:
- unit_test_esp32c3
patterns:
- unit_test
- build
- "build-unit_test-esp32c3"
included_in:
- "build:unit_test-esp32c3"
@ -120,6 +145,7 @@
- "integration_test"
included_in:
- "build:integration_test"
- build:target_test
- test:target_test
- test:any_test
@ -131,6 +157,9 @@
included_in:
- test:any_test
#################################
# Triggered Only By Labels Jobs #
#################################
"labels:{0}":
matrix:
- [weekend_test, iperf_stress_test, nvs_coverage]

View File

@ -101,7 +101,7 @@ check_public_headers:
scan_tests:
extends:
- .pre_check_base_template
- .rules:test:target_test
- .rules:build:target_test
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
tags:
- assign_test

View File

@ -42,7 +42,10 @@
- "tools/ci/build_example_dirs.txt"
- "tools/ci/get_supported_examples.sh"
.patterns-build: &patterns-build
.patterns-build_components: &patterns-build_components
- "components/**/*"
.patterns-build_system: &patterns-build_system
- "tools/cmake/**/*"
- "tools/kconfig_new/**/*"
- "tools/tools.json"
@ -420,7 +423,9 @@
- <<: *if-label-build
- <<: *if-title-build
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
.rules:build:component_ut-esp32:
rules:
@ -436,7 +441,9 @@
- <<: *if-label-unit_test_esp32
- <<: *if-title-unit_test_esp32
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
@ -454,7 +461,9 @@
- <<: *if-label-unit_test_esp32c3
- <<: *if-title-unit_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
@ -472,7 +481,9 @@
- <<: *if-label-unit_test_esp32s2
- <<: *if-title-unit_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
@ -490,7 +501,9 @@
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
@ -504,7 +517,9 @@
- <<: *if-label-custom_test_esp32
- <<: *if-title-custom_test_esp32
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
@ -518,7 +533,9 @@
- <<: *if-label-custom_test_esp32c3
- <<: *if-title-custom_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
@ -532,7 +549,9 @@
- <<: *if-label-custom_test_esp32s2
- <<: *if-title-custom_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
@ -546,7 +565,9 @@
- <<: *if-label-custom_test_esp32s3
- <<: *if-title-custom_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
@ -557,8 +578,6 @@
- <<: *if-title-build
- <<: *if-label-docker
- <<: *if-title-docker
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-docker
@ -604,10 +623,12 @@
- <<: *if-title-iperf_stress_test
- <<: *if-label-weekend_test
- <<: *if-title-weekend_test
- <<: *if-dev-push
changes: *patterns-build
- <<: *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
@ -620,10 +641,12 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32c3
- <<: *if-title-example_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
- <<: *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
@ -636,10 +659,12 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32s2
- <<: *if-title-example_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
- <<: *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
@ -652,10 +677,12 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-title-example_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *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
@ -677,7 +704,71 @@
- <<: *if-label-macos_test
- <<: *if-title-macos_test
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_system
.rules:build:target_test:
rules:
- <<: *if-protected
- <<: *if-label-build
- <<: *if-title-build
- <<: *if-label-component_ut
- <<: *if-title-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-title-component_ut_esp32
- <<: *if-label-component_ut_esp32c3
- <<: *if-title-component_ut_esp32c3
- <<: *if-label-component_ut_esp32s2
- <<: *if-title-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-title-component_ut_esp32s3
- <<: *if-label-custom_test
- <<: *if-title-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-title-custom_test_esp32
- <<: *if-label-custom_test_esp32c3
- <<: *if-title-custom_test_esp32c3
- <<: *if-label-custom_test_esp32s2
- <<: *if-title-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-title-custom_test_esp32s3
- <<: *if-label-example_test
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32
- <<: *if-title-example_test_esp32
- <<: *if-label-example_test_esp32c3
- <<: *if-title-example_test_esp32c3
- <<: *if-label-example_test_esp32s2
- <<: *if-title-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-title-example_test_esp32s3
- <<: *if-label-integration_test
- <<: *if-title-integration_test
- <<: *if-label-unit_test
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-title-unit_test_esp32
- <<: *if-label-unit_test_esp32c3
- <<: *if-title-unit_test_esp32c3
- <<: *if-label-unit_test_esp32s2
- <<: *if-title-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *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-component_ut
- <<: *if-dev-push
changes: *patterns-custom_test
- <<: *if-dev-push
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-integration_test
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:build:unit_test-esp32:
rules:
@ -689,7 +780,9 @@
- <<: *if-label-unit_test_esp32
- <<: *if-title-unit_test_esp32
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-unit_test
@ -701,9 +794,9 @@
- <<: *if-label-unit_test_esp32c3
- <<: *if-title-unit_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-unit_test
changes: *patterns-build_system
.rules:build:unit_test-esp32s2:
rules:
@ -715,7 +808,9 @@
- <<: *if-label-unit_test_esp32s2
- <<: *if-title-unit_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-unit_test
@ -729,7 +824,9 @@
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-unit_test
@ -741,7 +838,7 @@
- <<: *if-label-windows
- <<: *if-title-windows
- <<: *if-dev-push
changes: *patterns-build
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-windows
@ -814,8 +911,6 @@
- <<: *if-title-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -842,8 +937,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-title-unit_test_esp32
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-component_ut
@ -858,8 +951,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32c3
- <<: *if-title-unit_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-component_ut
@ -874,8 +965,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-title-unit_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-component_ut
@ -890,8 +979,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-component_ut
@ -902,8 +989,6 @@
- <<: *if-title-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-title-custom_test_esp32
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-custom_test
@ -914,8 +999,6 @@
- <<: *if-title-custom_test
- <<: *if-label-custom_test_esp32c3
- <<: *if-title-custom_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-custom_test
@ -926,8 +1009,6 @@
- <<: *if-title-custom_test
- <<: *if-label-custom_test_esp32s2
- <<: *if-title-custom_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-custom_test
@ -938,8 +1019,6 @@
- <<: *if-title-custom_test
- <<: *if-label-custom_test_esp32s3
- <<: *if-title-custom_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-custom_test
@ -950,8 +1029,6 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32
- <<: *if-title-example_test_esp32
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -964,8 +1041,6 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32c3
- <<: *if-title-example_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -978,8 +1053,6 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32s2
- <<: *if-title-example_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -992,8 +1065,6 @@
- <<: *if-title-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-title-example_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -1060,8 +1131,6 @@
- <<: *if-title-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -1082,8 +1151,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32
- <<: *if-title-unit_test_esp32
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-unit_test
@ -1092,10 +1159,6 @@
- <<: *if-protected
- <<: *if-label-unit_test_esp32c3
- <<: *if-title-unit_test_esp32c3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32s2:
rules:
@ -1104,8 +1167,6 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32s2
- <<: *if-title-unit_test_esp32s2
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-unit_test
@ -1116,7 +1177,5 @@
- <<: *if-title-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-title-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-build
- <<: *if-dev-push
changes: *patterns-unit_test