add README.md to explain how to add/modify jobs/rules/ifs

- rename existing labels to fit the naming convention
This commit is contained in:
Fu Hanxi
2020-10-20 15:00:50 +08:00
parent 1b06cbe3ef
commit 3026d562ec
10 changed files with 305 additions and 170 deletions

135
tools/ci/config/README.md Normal file
View File

@@ -0,0 +1,135 @@
# Rules for `rules.yml`
- [Rules for `rules.yml`](#rules-for-rulesyml)
- [How to Develop With `rules.yml`?](#how-to-develop-with-rulesyml)
- [How to Add a New `Job`?](#how-to-add-a-new-job)
- [How to Add a New `Rules` Template?](#how-to-add-a-new-rules-template)
- [How to Add a New `if` Anchor?](#how-to-add-a-new-if-anchor)
- [Naming Rules](#naming-rules)
- [Common Naming Rules](#common-naming-rules)
- [`if` Anchors Naming Rules](#if-anchors-naming-rules)
- [Common Phrases/Abbreviations](#common-phrasesabbreviations)
- [`rules` Template Naming Rules](#rules-template-naming-rules)
- [Reusable Shell Script `tools/ci/utils.sh`](#reusable-shell-script-toolsciutilssh)
- [Functions](#functions)
- [CI Job Related](#ci-job-related)
- [Shell Script Related](#shell-script-related)
## How to Develop With `rules.yml`?
### How to Add a New `Job`?
check if there's a suitable `.rules:<rules-you-need>` template
1. if there is, put this in the job `extends`. All done, now you can close this window. (`extends` could be array or string)
2. if there isn't
1. check [How to Add a New `Rules` Template?](#how-to-add-a-new-rules-template), create a suitable one
2. follow step 1
### How to Add a New `Rules` Template?
check if there's a suitable `.if-<if-anchor-you-need>` anchor
1. if there is, create a rule following [`rules` Template Naming Rules](#rules-template-naming-rules).For detail information, please refer to [GitLab Documentation `rules-if`](https://docs.gitlab.com/ee/ci/yaml/README.html#rulesif). Here's an example.
```yaml
.rules:dev:
rules:
- <<: *if-trigger
- <<: *if-dev-push
```
2. if there isn't
1. check [How to Add a New `if` Anchor?](#how-to-add-a-new-if-anchor), create a suitable one
2. follow step 1
### How to Add a New `if` Anchor?
Create an `if` anchor following [`if` Anchors Naming Rules](#if-anchors-naming-rules). For detail information about how to write the condition clause, please refer to [GitLab Documentation `only/except (advanced)](https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-advanced). Here's an example.
```yaml
.if-schedule: &if-schedule:
if: '$CI_PIPELINE_SOURCE == "schedule"'
```
## Naming Rules
### Common Naming Rules
if a phrase has multi words, use `_` to concat them.
> e.g. `regular_test`
if a name have multi phrase, use `-` to concat them.
> e.g. `regular_test-example_test`
### `if` Anchors Naming Rules
- if it's a label: `.if-label-<label_name>`
- if it's a ref: `.if-ref-<ref_name>`
- if it's a branch: `.if-branch-<branch_name>`
- if it's a tag: `.if-tag-<tag_name>`
- if it's a operating system: `.if-os-mac`
- if it's multi-type combination: `.if-ref-<release_name>-branch-<branch_name>`
#### Common Phrases/Abbreviations
- `no_label`
`$BOT_TRIGGER_WITH_LABEL == null`
- `protected`
`($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)`
- `target_test`
`example_test` or `custom_test` or `unit_test-all_targets`
### `rules` Template Naming Rules
- if it's os related: `.rules:os:<os_name>`
- if it's tag related: `.rules:tag:<tag_1>-<tag_2>`
- if it's label related: `.rules:labels:<label_1>-<label_2>`
By default, all `.rules:labels` should include both `if-label-regular_test` and `if-protected-no-label` implicitly, unless they have special postfixes:
- slim: `regular_test` not included
- only: only have the phrases listed
- if it's target test related: `.rules:tests:<test_type_1>-<test_type_2>`
By default, all `.rules:tests` should include `if-protected-no_label` implicitly, unless they have special postfixes (same as above)
- if it needs to build at first, then do some target test: `.rules:build_tests:<test_type_1>-<test_type_2>`
By default, all `.rules:build_tests` should include `if-protected-no-label`, `if-label-build`, `if-label-regular-test` implictly, unless they have special postfixes (same as above)
- if a job supports all targets, use `-all_targets` as postfix
## Reusable Shell Script `tools/ci/utils.sh`
It is used to put all the reusable shell script as small functions. If you want to set `before_script: []` for you job, now you can set `extends: .before_script_slim` instead. it will only run `source tools/ci/utils.sh`
If you're developing CI shell scripts, you can use these functions without source. They're already included in all `before_script`
To run these commands in shell script locally, place `source tools/ci/utils.sh` at the very beginning.
### Functions
#### CI Job Related
- `apply_bot_filter`
- `add_gitlab_ssh_keys`
- `add_github_ssh_keys`
- `add_doc_server_ssh_keys`
- `fetch_submodules`
- `get_all_submodules`
#### Shell Script Related
- `error`: log in red color
- `warning`: log in orange color
- `info`: log in green color
- `run_cmd`: run the command with duration seconds info
- `retry_failed`: run the command with duration seconds info, retry when failed

View File

@@ -1,6 +1,6 @@
assign_test: assign_test:
extends: extends:
- .rules:test:target_test-weekend_test - .rules:tests:target_test-integration_test-weekend_test
tags: tags:
- assign_test - assign_test
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
@@ -49,7 +49,7 @@ assign_test:
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b $IDF_PATH/SSC/ssc_bin -o $INTEGRATION_CONFIG_OUTPUT_PATH - python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b $IDF_PATH/SSC/ssc_bin -o $INTEGRATION_CONFIG_OUTPUT_PATH
update_test_cases: update_test_cases:
extends: .rules:master-schedule extends: .rules:ref:master-schedule
stage: assign_test stage: assign_test
image: $CI_DOCKER_REGISTRY/ubuntu-test-env image: $CI_DOCKER_REGISTRY/ubuntu-test-env
tags: tags:

View File

@@ -62,7 +62,7 @@ check_docs_gh_links:
.build_ssc_template: .build_ssc_template:
extends: extends:
- .build_template - .build_template
- .rules:labels:build-integration_test - .rules:build_tests:integration_test
artifacts: artifacts:
paths: paths:
- SSC/ssc_bin - SSC/ssc_bin
@@ -88,7 +88,7 @@ build_ssc_esp32s2:
.build_esp_idf_tests_cmake: .build_esp_idf_tests_cmake:
extends: extends:
- .build_template - .build_template
- .rules:labels:build-unit_test - .rules:build_tests:unit_test
artifacts: artifacts:
paths: paths:
- tools/unit-test-app/output/${IDF_TARGET} - tools/unit-test-app/output/${IDF_TARGET}
@@ -131,7 +131,7 @@ build_esp_idf_tests_cmake_esp32s3:
.build_examples_template: .build_examples_template:
extends: extends:
- .build_template - .build_template
- .rules:labels:build-example_test-weekend_test - .rules:build_tests:example_test-weekend_test
variables: variables:
TEST_PREFIX: examples TEST_PREFIX: examples
TEST_RELATIVE_DIR: examples TEST_RELATIVE_DIR: examples
@@ -202,7 +202,7 @@ build_examples_cmake_esp32s2:
.build_test_apps: .build_test_apps:
extends: extends:
- .build_examples_cmake - .build_examples_cmake
- .rules:labels:build-custom_test-weekend_test - .rules:build_tests:custom_test-weekend_test
variables: variables:
TEST_PREFIX: test_apps TEST_PREFIX: test_apps
TEST_RELATIVE_DIR: tools/test_apps TEST_RELATIVE_DIR: tools/test_apps
@@ -225,7 +225,7 @@ build_test_apps_esp32s2:
.build_component_ut: .build_component_ut:
extends: extends:
- .build_test_apps - .build_test_apps
- .rules:labels:build-unit_test - .rules:build_tests:unit_test
variables: variables:
TEST_PREFIX: component_ut TEST_PREFIX: component_ut
TEST_RELATIVE_DIR: component_ut TEST_RELATIVE_DIR: component_ut
@@ -282,7 +282,7 @@ build_docs_pdf:
.test_build_system_template: .test_build_system_template:
extends: extends:
- .build_template - .build_template
- .rules:labels:build-weekend_test - .rules:build_tests:weekend_test
script: script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- rm -rf test_build_system - rm -rf test_build_system
@@ -311,7 +311,7 @@ test_build_system_cmake_macos:
build_docker: build_docker:
extends: extends:
- .before_script_slim - .before_script_slim
- .rules:master-release-schedule - .rules:protected-schedule
stage: build stage: build
image: espressif/docker-builder:1 image: espressif/docker-builder:1
tags: tags:
@@ -333,7 +333,7 @@ build_docker:
.test-on-windows: .test-on-windows:
extends: extends:
- .before_script_slim - .before_script_slim
- .rules:master-release-schedule - .rules:protected-schedule
stage: build stage: build
image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross image: $CI_DOCKER_REGISTRY/esp32-toolchain-win-cross
tags: tags:
@@ -366,7 +366,7 @@ build_cmdlinerunner:
build_installer: build_installer:
extends: extends:
- .before_script_slim - .before_script_slim
- .rules:master-release-schedule - .rules:protected-schedule
# using a different stage here to be able to use artifacts from build_cmdlinerunner job # using a different stage here to be able to use artifacts from build_cmdlinerunner job
stage: host_test stage: host_test
image: $CI_DOCKER_REGISTRY/wine-innosetup:1 image: $CI_DOCKER_REGISTRY/wine-innosetup:1
@@ -449,7 +449,7 @@ code_quality_check:
code_quality_report: code_quality_report:
extends: extends:
- .sonar_scan_template - .sonar_scan_template
- .rules:master-release-schedule - .rules:protected-schedule
script: script:
- sonar-scanner - sonar-scanner
-Dsonar.host.url=$SONAR_HOST_URL -Dsonar.host.url=$SONAR_HOST_URL

View File

@@ -36,7 +36,7 @@ clang_tidy_deploy:
clang_tidy_deploy_regular: clang_tidy_deploy_regular:
extends: extends:
- .clang_tidy_deploy_template - .clang_tidy_deploy_template
- .rules:labels:static_analysis - .rules:labels:static_analysis-only
needs: needs:
- clang_tidy_check_regular - clang_tidy_check_regular
@@ -44,7 +44,7 @@ push_to_github:
extends: extends:
- .deploy_job_template - .deploy_job_template
- .before_script_lesser - .before_script_lesser
- .rules:deploy - .rules:protected-no_label
script: script:
- add_github_ssh_keys - add_github_ssh_keys
- git remote remove github &>/dev/null || true - git remote remove github &>/dev/null || true
@@ -91,7 +91,7 @@ deploy_docs_production:
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings # The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
extends: extends:
- .deploy_docs_template - .deploy_docs_template
- .rules:deploy - .rules:protected-no_label
variables: variables:
TYPE: "preview" TYPE: "preview"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY" DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
@@ -104,7 +104,7 @@ deploy_test_result:
extends: extends:
- .deploy_job_template - .deploy_job_template
- .before_script_slim - .before_script_slim
- .rules:master-schedule-always - .rules:ref:master-schedule-always
image: $CI_DOCKER_REGISTRY/bot-env image: $CI_DOCKER_REGISTRY/bot-env
tags: tags:
- deploy_test - deploy_test

View File

@@ -9,7 +9,7 @@
.host_fuzzer_test_template: .host_fuzzer_test_template:
extends: extends:
- .host_test_template - .host_test_template
- .rules:labels:fuzzer_test-weekend_test - .rules:labels:fuzzer_test-weekend_test-only
image: $CI_DOCKER_REGISTRY/afl-fuzzer-test image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
artifacts: artifacts:
when: always when: always
@@ -35,7 +35,7 @@ test_nvs_on_host:
test_nvs_coverage: test_nvs_coverage:
extends: extends:
- .host_test_template - .host_test_template
- .rules:labels:nvs_coverage - .rules:labels:nvs_coverage-only
artifacts: artifacts:
paths: paths:
- components/nvs_flash/test_nvs_host/coverage_report - components/nvs_flash/test_nvs_host/coverage_report

View File

@@ -44,7 +44,7 @@ check_submodule_sync:
check_ut_cmake_make: check_ut_cmake_make:
extends: extends:
- .post_check_job_template_with_filter - .post_check_job_template_with_filter
- .rules:dev_push-trigger - .rules:dev
tags: tags:
- build - build
script: script:
@@ -59,7 +59,7 @@ check_artifacts_expire_time:
check_pipeline_triggered_by_label: check_pipeline_triggered_by_label:
extends: extends:
- .post_check_job_template - .post_check_job_template
- .rules:dev_push-trigger - .rules:dev
script: script:
# If the pipeline is triggered with label, the pipeline will only succeeded if "regular_test" label is added. # If the pipeline is triggered with label, the pipeline will only succeeded if "regular_test" label is added.
# We want to make sure some jobs are always executed to detect regression. # We want to make sure some jobs are always executed to detect regression.

View File

@@ -1,5 +1,5 @@
.check_doc_links_template: .check_doc_links_template:
extends: .rules:master-release extends: .rules:protected
stage: post_deploy stage: post_deploy
image: $ESP_IDF_DOC_ENV_IMAGE image: $ESP_IDF_DOC_ENV_IMAGE
tags: [ "build", "amd64", "internet" ] tags: [ "build", "amd64", "internet" ]

View File

@@ -38,7 +38,7 @@ check_version:
# esp_idf_version.h in a branch before tagging the next version. # esp_idf_version.h in a branch before tagging the next version.
extends: extends:
- .pre_check_job_template - .pre_check_job_template
- .rules:master-release - .rules:protected
script: script:
- export IDF_PATH=$PWD - export IDF_PATH=$PWD
- tools/ci/check_idf_version.sh - tools/ci/check_idf_version.sh
@@ -46,7 +46,7 @@ check_version:
check_examples_cmake_make: check_examples_cmake_make:
extends: extends:
- .pre_check_job_template_with_filter - .pre_check_job_template_with_filter
- .rules:dev_push-trigger - .rules:dev
script: script:
- python ${IDF_PATH}/tools/ci/check_examples_cmake_make.py - python ${IDF_PATH}/tools/ci/check_examples_cmake_make.py
@@ -123,7 +123,7 @@ check_public_headers:
scan_tests: scan_tests:
extends: extends:
- .scan_build_tests - .scan_build_tests
- .rules:tests:build-ttfw_tests - .rules:build_tests:target_test
artifacts: artifacts:
paths: paths:
- $EXAMPLE_TEST_OUTPUT_DIR - $EXAMPLE_TEST_OUTPUT_DIR
@@ -193,6 +193,6 @@ check_codeowners:
check_version_tag: check_version_tag:
extends: extends:
- .pre_check_job_template - .pre_check_job_template
- .rules:release-tag - .rules:tag:release-no_label
script: script:
- (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || echo "ESP-IDF versions must be annotated tags." && exit 1 - (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || echo "ESP-IDF versions must be annotated tags." && exit 1

View File

@@ -1,13 +1,14 @@
.if-master-refs: &if-master-refs # if anchors
.if-ref-master: &if-ref-master
if: '$CI_COMMIT_REF_NAME == "master"' if: '$CI_COMMIT_REF_NAME == "master"'
.if-release-branch: &if-release-branch .if-tag-release-no_label: &if-tag-release-no_label
if: '$CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/'
.if-release-tag-regular: &if-release-tag-regular
if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/ && $BOT_TRIGGER_WITH_LABEL == null' if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/ && $BOT_TRIGGER_WITH_LABEL == null'
.if-master-release-regular: &if-master-release-regular .if-protected: &if-protected
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
.if-protected-no_label: &if-protected-no_label
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null' if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
.if-dev-push: &if-dev-push .if-dev-push: &if-dev-push
@@ -19,221 +20,220 @@
.if-trigger: &if-trigger .if-trigger: &if-trigger
if: '$CI_PIPELINE_SOURCE == "trigger"' if: '$CI_PIPELINE_SOURCE == "trigger"'
.if-label-regular-test: &if-label-regular-test .if-label-regular_test: &if-label-regular_test
if: '$BOT_LABEL_REGULAR_TEST' if: '$BOT_LABEL_REGULAR_TEST'
.if-label-build: &if-label-build .if-label-build: &if-label-build
if: '$BOT_LABEL_BUILD' if: '$BOT_LABEL_BUILD'
.if-label-build-docs: &if-label-build-docs .if-label-build_docs: &if-label-build_docs
if: '$BOT_LABEL_BUILD_DOCS' if: '$BOT_LABEL_BUILD_DOCS'
.if-label-integration-test: &if-label-integration-test .if-label-integration_test: &if-label-integration_test
if: '$BOT_LABEL_INTEGRATION_TEST' if: '$BOT_LABEL_INTEGRATION_TEST'
.if-label-unit-test: &if-label-unit-test .if-label-unit_test: &if-label-unit_test
if: '$BOT_LABEL_UNIT_TEST' if: '$BOT_LABEL_UNIT_TEST'
.if-label-unit-test-s2: &if-label-unit-test-s2 .if-label-unit_test_s2: &if-label-unit_test_s2
if: '$BOT_LABEL_UNIT_TEST_S2' if: '$BOT_LABEL_UNIT_TEST_S2'
.if-label-unit-test-all-target: &if-label-unit-test-all-target .if-label-unit_test-all_targets: &if-label-unit_test-all_targets
if: '$BOT_LABEL_UNIT_TEST || $BOT_LABEL_UNIT_TEST_S2' if: '$BOT_LABEL_UNIT_TEST || $BOT_LABEL_UNIT_TEST_S2'
.if-label-weekend-test: &if-label-weekend-test .if-label-weekend_test: &if-label-weekend_test
if: '$BOT_LABEL_WEEKEND_TEST' if: '$BOT_LABEL_WEEKEND_TEST'
.if-label-example-test: &if-label-example-test .if-label-example_test: &if-label-example_test
if: '$BOT_LABEL_EXAMPLE_TEST' if: '$BOT_LABEL_EXAMPLE_TEST'
.if-label-custom-test: &if-label-custom-test .if-label-custom_test: &if-label-custom_test
if: '$BOT_LABEL_CUSTOM_TEST' if: '$BOT_LABEL_CUSTOM_TEST'
.if-label-host-test: &if-label-host-test .if-label-host_test: &if-label-host_test
if: '$BOT_LABEL_HOST_TEST' if: '$BOT_LABEL_HOST_TEST'
.if-label-fuzzer-test: &if-label-fuzzer-test .if-label-fuzzer_test: &if-label-fuzzer_test
if: '$BOT_LABEL_FUZZER_TEST' if: '$BOT_LABEL_FUZZER_TEST'
.if-label-nvs-coverage: &if-label-nvs-coverage .if-label-nvs_coverage: &if-label-nvs_coverage
if: '$BOT_LABEL_NVS_COVERAGE' if: '$BOT_LABEL_NVS_COVERAGE'
.if-label-static-analysis: &if-label-static-analysis .if-label-static_analysis: &if-label-static_analysis
if: '$BOT_LABEL_STATIC_ANALYSIS || $BOT_LABEL_STATIC_ANALYSIS_ALL' if: '$BOT_LABEL_STATIC_ANALYSIS || $BOT_LABEL_STATIC_ANALYSIS_ALL'
.if-label-iperf-stress-test: &if-label-iperf-stress-test .if-label-iperf_stress_test: &if-label-iperf_stress_test
if: '$BOT_LABEL_IPERF_STRESS_TEST' if: '$BOT_LABEL_IPERF_STRESS_TEST'
.if-os-mac: &if-os-mac .if-os-mac: &if-os-mac
if: '$BOT_LABEL_MACOS_TEST' if: '$BOT_LABEL_MACOS_TEST'
.rules:master-release: # Rules templates
.rules:protected:
rules: rules:
- <<: *if-master-refs - <<: *if-protected
- <<: *if-release-branch
.rules:release-tag: .rules:protected-no_label:
rules: rules:
- <<: *if-release-tag-regular - <<: *if-protected-no_label
.rules:deploy: .rules:protected-schedule:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected
.rules:master-schedule:
rules:
- <<: *if-master-refs
- <<: *if-schedule
.rules:master-schedule-always:
rules:
- <<: *if-master-refs
when: always
- <<: *if-schedule
when: always
.rules:master-release-schedule:
rules:
- <<: *if-master-refs
- <<: *if-release-branch
- <<: *if-schedule - <<: *if-schedule
.rules:trigger: .rules:trigger:
rules: rules:
- <<: *if-trigger - <<: *if-trigger
.rules:dev_push-trigger: .rules:dev:
rules: rules:
- <<: *if-trigger - <<: *if-trigger
- <<: *if-dev-push - <<: *if-dev-push
.rules:labels:static_analysis: .rules:os:mac_os:
rules: rules:
- <<: *if-label-static-analysis - <<: *if-protected-no_label
- <<: *if-os-mac
.rules:tag:release-no_label:
rules:
- <<: *if-tag-release-no_label
.rules:ref:master-schedule:
rules:
- <<: *if-ref-master
- <<: *if-schedule
.rules:ref:master-schedule-always:
rules:
- <<: *if-ref-master
when: always
- <<: *if-schedule
when: always
.rules:labels:static_analysis-only:
rules:
- <<: *if-label-static_analysis
.rules:labels:build: .rules:labels:build:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-build - <<: *if-label-build
.rules:labels:build_docs: .rules:labels:build_docs:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-build-docs - <<: *if-label-build_docs
.rules:labels:build_docs-slim: .rules:labels:build_docs-slim:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build-docs - <<: *if-label-build_docs
.rules:labels:host_test:
rules:
- <<: *if-master-release-regular
- <<: *if-label-regular-test
- <<: *if-label-host-test
.rules:labels:example_test:
rules:
- <<: *if-master-release-regular
- <<: *if-schedule
- <<: *if-label-example-test
.rules:labels:custom_test:
rules:
- <<: *if-master-release-regular
- <<: *if-schedule
- <<: *if-label-custom-test
.rules:labels:unit_test:
rules:
- <<: *if-master-release-regular
- <<: *if-label-unit-test
.rules:labels:unit_test_s2-only:
rules:
- <<: *if-label-unit-test-s2
.rules:labels:integration_test:
rules:
- <<: *if-master-release-regular
- <<: *if-label-integration-test
.rules:labels:weekend_test-only: .rules:labels:weekend_test-only:
rules: rules:
- <<: *if-label-weekend-test - <<: *if-label-weekend_test
.rules:labels:iperf_stress_test-only: .rules:labels:iperf_stress_test-only:
rules: rules:
- <<: *if-label-iperf-stress-test - <<: *if-label-iperf_stress_test
.rules:labels:build-integration_test: .rules:labels:fuzzer_test-weekend_test-only:
rules: rules:
- <<: *if-master-release-regular - <<: *if-label-fuzzer_test
- <<: *if-label-weekend_test
.rules:labels:nvs_coverage-only:
rules:
- <<: *if-label-nvs_coverage
.rules:labels:host_test:
rules:
- <<: *if-protected-no_label
- <<: *if-label-regular_test
- <<: *if-label-host_test
.rules:tests:example_test-schedule:
rules:
- <<: *if-protected-no_label
- <<: *if-label-example_test
- <<: *if-schedule
.rules:tests:custom_test-schedule:
rules:
- <<: *if-protected-no_label
- <<: *if-label-custom_test
- <<: *if-schedule
.rules:tests:unit_test:
rules:
- <<: *if-protected-no_label
- <<: *if-label-unit_test
.rules:tests:unit_test_s2-only:
rules:
- <<: *if-label-unit_test_s2
.rules:tests:integration_test:
rules:
- <<: *if-protected-no_label
- <<: *if-label-integration_test
.rules:tests:target_test-integration_test-weekend_test:
rules:
- <<: *if-protected-no_label
- <<: *if-label-example_test
- <<: *if-label-custom_test
- <<: *if-label-unit_test-all_targets
- <<: *if-label-integration_test
- <<: *if-label-weekend_test
.rules:build_tests:integration_test:
rules:
- <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-integration-test - <<: *if-label-integration_test
.rules:labels:build-weekend_test: .rules:build_tests:weekend_test:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-weekend-test - <<: *if-label-weekend_test
.rules:labels:build-unit_test: .rules:build_tests:unit_test:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-unit-test-all-target - <<: *if-label-unit_test-all_targets
.rules:labels:build-example_test-weekend_test: .rules:build_tests:example_test-weekend_test:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-example-test - <<: *if-label-example_test
- <<: *if-label-weekend-test - <<: *if-label-weekend_test
.rules:labels:build-custom_test-weekend_test: .rules:build_tests:custom_test-weekend_test:
rules: rules:
- <<: *if-master-release-regular - <<: *if-protected-no_label
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-custom-test - <<: *if-label-custom_test
- <<: *if-label-weekend-test - <<: *if-label-weekend_test
.rules:labels:fuzzer_test-weekend_test: .rules:build_tests:target_test:
rules: rules:
- <<: *if-label-fuzzer-test - <<: *if-protected-no_label
- <<: *if-label-weekend-test
.rules:labels:nvs_coverage:
rules:
- <<: *if-label-nvs-coverage
.rules:test:target_test-weekend_test:
rules:
- <<: *if-master-release-regular
- <<: *if-label-example-test
- <<: *if-label-custom-test
- <<: *if-label-unit-test-all-target
- <<: *if-label-integration-test
- <<: *if-label-weekend-test
.rules:tests:build-ttfw_tests:
rules:
- <<: *if-master-release-regular
- <<: *if-label-build - <<: *if-label-build
- <<: *if-label-regular-test - <<: *if-label-regular_test
- <<: *if-label-example-test - <<: *if-label-example_test
- <<: *if-label-custom-test - <<: *if-label-custom_test
- <<: *if-label-unit-test-all-target - <<: *if-label-unit_test-all_targets
.rules:os:mac_os:
rules:
- <<: *if-master-release-regular
- <<: *if-os-mac

View File

@@ -35,7 +35,7 @@
.example_test_template: .example_test_template:
extends: extends:
- .target_test_job_template - .target_test_job_template
- .rules:labels:example_test - .rules:tests:example_test-schedule
variables: variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/examples" TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/examples/test_configs" CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/examples/test_configs"
@@ -48,7 +48,7 @@
.test_app_template: .test_app_template:
extends: extends:
- .target_test_job_template - .target_test_job_template
- .rules:labels:custom_test - .rules:tests:custom_test-schedule
variables: variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/test_apps" TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/test_apps"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/test_apps/test_configs" CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/test_apps/test_configs"
@@ -56,7 +56,7 @@
.component_ut_template: .component_ut_template:
extends: extends:
- .target_test_job_template - .target_test_job_template
- .rules:labels:unit_test - .rules:tests:unit_test
variables: variables:
TEST_CASE_PATH: "$COMPONENT_UT_DIRS" TEST_CASE_PATH: "$COMPONENT_UT_DIRS"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/component_ut/test_configs" CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/component_ut/test_configs"
@@ -76,7 +76,7 @@
.unit_test_template: .unit_test_template:
extends: extends:
- .target_test_job_template - .target_test_job_template
- .rules:labels:unit_test - .rules:tests:unit_test
variables: variables:
TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app" TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/components/idf_test/unit_test/CIConfigs" CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/components/idf_test/unit_test/CIConfigs"
@@ -85,7 +85,7 @@
.integration_test_template: .integration_test_template:
extends: extends:
- .target_test_job_template - .target_test_job_template
- .rules:labels:integration_test - .rules:tests:integration_test
needs: needs:
- assign_test - assign_test
- build_ssc_esp32 - build_ssc_esp32
@@ -475,7 +475,7 @@ UT_034:
.unit_test_s2_template: .unit_test_s2_template:
extends: extends:
- .unit_test_template - .unit_test_template
- .rules:labels:unit_test_s2-only # due to the lack of runners, s2 tests will only be triggered by label - .rules:tests:unit_test_s2-only # due to the lack of runners, s2 tests will only be triggered by label
UT_035: UT_035:
extends: .unit_test_s2_template extends: .unit_test_s2_template