Merge branch 'ci/minimum_pipeline_for_revert_branch' into 'master'

ci: minimum pipeline for 'revert-' branches

Closes IDFCI-920

See merge request espressif/esp-idf!15592
This commit is contained in:
Ivan Grokhotkov
2021-10-26 12:14:30 +00:00
3 changed files with 102 additions and 15 deletions

View File

@@ -1,18 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
# #
# Copyright 2021 Espressif Systems (Shanghai) CO LTD # SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
# # SPDX-License-Identifier: Apache-2.0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse import argparse
import inspect import inspect
@@ -88,6 +77,8 @@ class RulesWriter:
RULE_PROTECTED_NO_LABEL = ' - <<: *if-protected-no_label' RULE_PROTECTED_NO_LABEL = ' - <<: *if-protected-no_label'
RULE_BUILD_ONLY = ' - <<: *if-label-build-only\n' \ RULE_BUILD_ONLY = ' - <<: *if-label-build-only\n' \
' when: never' ' when: never'
RULE_REVERT_BRANCH = ' - <<: *if-revert-branch\n' \
' when: never'
RULE_LABEL_TEMPLATE = ' - <<: *if-label-{0}' RULE_LABEL_TEMPLATE = ' - <<: *if-label-{0}'
RULE_PATTERN_TEMPLATE = ' - <<: *if-dev-push\n' \ RULE_PATTERN_TEMPLATE = ' - <<: *if-dev-push\n' \
' changes: *patterns-{0}' ' changes: *patterns-{0}'
@@ -211,7 +202,7 @@ class RulesWriter:
return '\n\n'.join(res) return '\n\n'.join(res)
def _format_rule(self, name, cfg): # type: (str, dict) -> str def _format_rule(self, name, cfg): # type: (str, dict) -> str
_rules = [] _rules = [self.RULE_REVERT_BRANCH]
if name.endswith('-production'): if name.endswith('-production'):
_rules.append(self.RULE_PROTECTED_NO_LABEL) _rules.append(self.RULE_PROTECTED_NO_LABEL)
else: else:

View File

@@ -196,6 +196,9 @@
.if-label-build-only: &if-label-build-only .if-label-build-only: &if-label-build-only
if: '$CI_JOB_STAGE == "target_test" && $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*For Maintainers: Only Build Tests(?:,[^,\n\r]+)*$/i' if: '$CI_JOB_STAGE == "target_test" && $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*For Maintainers: Only Build Tests(?:,[^,\n\r]+)*$/i'
.if-revert-branch: &if-revert-branch
if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^revert-/'
######### #########
# Rules # # Rules #
######### #########
@@ -359,6 +362,8 @@
.rules:build: .rules:build:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-dev-push - <<: *if-dev-push
@@ -368,6 +373,8 @@
.rules:build:component_ut-esp32: .rules:build:component_ut-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-component_ut - <<: *if-label-component_ut
@@ -383,6 +390,8 @@
.rules:build:component_ut-esp32c3: .rules:build:component_ut-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-component_ut - <<: *if-label-component_ut
@@ -398,6 +407,8 @@
.rules:build:component_ut-esp32s2: .rules:build:component_ut-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-component_ut - <<: *if-label-component_ut
@@ -413,6 +424,8 @@
.rules:build:component_ut-esp32s3: .rules:build:component_ut-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-component_ut - <<: *if-label-component_ut
@@ -428,6 +441,8 @@
.rules:build:custom_test-esp32: .rules:build:custom_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-custom_test - <<: *if-label-custom_test
@@ -442,6 +457,8 @@
.rules:build:custom_test-esp32c3: .rules:build:custom_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-custom_test - <<: *if-label-custom_test
@@ -455,6 +472,8 @@
.rules:build:custom_test-esp32s2: .rules:build:custom_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-custom_test - <<: *if-label-custom_test
@@ -468,6 +487,8 @@
.rules:build:custom_test-esp32s3: .rules:build:custom_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-custom_test - <<: *if-label-custom_test
@@ -481,6 +502,8 @@
.rules:build:docker: .rules:build:docker:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-docker - <<: *if-label-docker
@@ -489,6 +512,8 @@
.rules:build:example_test-esp32: .rules:build:example_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-example_test - <<: *if-label-example_test
@@ -505,6 +530,8 @@
.rules:build:example_test-esp32c3: .rules:build:example_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-example_test - <<: *if-label-example_test
@@ -520,6 +547,8 @@
.rules:build:example_test-esp32s2: .rules:build:example_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-example_test - <<: *if-label-example_test
@@ -535,6 +564,8 @@
.rules:build:example_test-esp32s3: .rules:build:example_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-example_test - <<: *if-label-example_test
@@ -550,6 +581,8 @@
.rules:build:integration_test: .rules:build:integration_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-integration_test - <<: *if-label-integration_test
@@ -562,6 +595,8 @@
.rules:build:macos: .rules:build:macos:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-macos - <<: *if-label-macos
@@ -571,6 +606,8 @@
.rules:build:target_test: .rules:build:target_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-component_ut - <<: *if-label-component_ut
@@ -615,6 +652,8 @@
.rules:build:unit_test-esp32: .rules:build:unit_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-unit_test - <<: *if-label-unit_test
@@ -628,6 +667,8 @@
.rules:build:unit_test-esp32c3: .rules:build:unit_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-unit_test - <<: *if-label-unit_test
@@ -641,6 +682,8 @@
.rules:build:unit_test-esp32s2: .rules:build:unit_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-unit_test - <<: *if-label-unit_test
@@ -654,6 +697,8 @@
.rules:build:unit_test-esp32s3: .rules:build:unit_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-unit_test - <<: *if-label-unit_test
@@ -667,6 +712,8 @@
.rules:build:windows: .rules:build:windows:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-windows - <<: *if-label-windows
@@ -677,23 +724,33 @@
.rules:labels:fuzzer_test-weekend_test: .rules:labels:fuzzer_test-weekend_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-label-fuzzer_test - <<: *if-label-fuzzer_test
- <<: *if-label-weekend_test - <<: *if-label-weekend_test
.rules:labels:iperf_stress_test: .rules:labels:iperf_stress_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-label-iperf_stress_test - <<: *if-label-iperf_stress_test
.rules:labels:nvs_coverage: .rules:labels:nvs_coverage:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-label-nvs_coverage - <<: *if-label-nvs_coverage
.rules:labels:weekend_test: .rules:labels:weekend_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-label-weekend_test - <<: *if-label-weekend_test
.rules:test:any_test: .rules:test:any_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -738,6 +795,8 @@
.rules:test:component_ut-esp32: .rules:test:component_ut-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -750,6 +809,8 @@
.rules:test:component_ut-esp32c3: .rules:test:component_ut-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -762,6 +823,8 @@
.rules:test:component_ut-esp32s2: .rules:test:component_ut-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -774,6 +837,8 @@
.rules:test:component_ut-esp32s3: .rules:test:component_ut-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -786,6 +851,8 @@
.rules:test:custom_test-esp32: .rules:test:custom_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -796,6 +863,8 @@
.rules:test:custom_test-esp32c3: .rules:test:custom_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -806,6 +875,8 @@
.rules:test:custom_test-esp32s2: .rules:test:custom_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -816,6 +887,8 @@
.rules:test:custom_test-esp32s3: .rules:test:custom_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -826,6 +899,8 @@
.rules:test:example_test-esp32: .rules:test:example_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -838,6 +913,8 @@
.rules:test:example_test-esp32c3: .rules:test:example_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -850,6 +927,8 @@
.rules:test:example_test-esp32s2: .rules:test:example_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -862,6 +941,8 @@
.rules:test:example_test-esp32s3: .rules:test:example_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -874,6 +955,8 @@
.rules:test:host_test: .rules:test:host_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -883,6 +966,8 @@
.rules:test:integration_test: .rules:test:integration_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -892,6 +977,8 @@
.rules:test:submodule: .rules:test:submodule:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -901,6 +988,8 @@
.rules:test:target_test: .rules:test:target_test:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -940,6 +1029,8 @@
.rules:test:unit_test-esp32: .rules:test:unit_test-esp32:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -950,6 +1041,8 @@
.rules:test:unit_test-esp32c3: .rules:test:unit_test-esp32c3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -960,6 +1053,8 @@
.rules:test:unit_test-esp32s2: .rules:test:unit_test-esp32s2:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never
@@ -970,6 +1065,8 @@
.rules:test:unit_test-esp32s3: .rules:test:unit_test-esp32s3:
rules: rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected - <<: *if-protected
- <<: *if-label-build-only - <<: *if-label-build-only
when: never when: never

View File

@@ -1,4 +1,3 @@
.gitlab/ci/dependencies/generate_rules.py
components/app_trace/port/include/esp_app_trace_port.h components/app_trace/port/include/esp_app_trace_port.h
components/app_trace/port/riscv/port.c components/app_trace/port/riscv/port.c
components/app_trace/private_include/esp_app_trace_membufs_proto.h components/app_trace/private_include/esp_app_trace_membufs_proto.h