- IDF CI
- Push to a remote branch
- Create an MR, choose related labels (not required)
- A
detachedpipeline will be created. - if you push a new commit, a new pipeline will be created automatically.
-
check the file patterns
If you found a job that is not running as expected with some file changes, a git commit to improve the
patternwill be appreciated. -
please add MR labels to run additional tests, currently we have to do this only for
target-testjobs, please use it as few as possible. Our final goal is to remove all the labels and let the file changes decide everything!
buildbuild_docscomponent_ut[_esp32/esp32s2/...]custom_test[_esp32/esp32s2/...]dockerdocsexample_test[_esp32/esp32s2/...]fuzzer_testhost_testintegration_testiperf_stress_testmacosmacos_testnvs_coverages 8AED ubmoduleunit_test[_esp32/esp32s2/...]weekend_testwindows
There are two general labels (not recommended since these two labels will trigger a lot of jobs)
target_test: includes all target forexample_test,custom_test,component_ut,unit_test,integration_testall_test: includes all test labels
Go to MR web page -> Pipelines tab -> click Run pipeline button.
In very rare case, this tab will not show up because no merge_request pipeline is created before. Please use web API then.
curl -X POST --header "PRIVATE-TOKEN: [YOUR PERSONAL ACCESS TOKEN]" [GITLAB_SERVER]/api/v4/projects/103/merge_requests/[MERGE_REQUEST_IID]/pipelines-
pattern: Defined in an array. A GitLab job will be created if the changed files in this MR matched one of the patterns. For example:.patterns-python-files: &patterns-python-files - "**/*.py"
-
label: Defined in an if clause, similar as the previous bot command. A GitLab job will be created if the pipeline variables contains variables inBOT_LABEL_xxxformat (DEPRECATED) or included in the MR labels. For example:.if-label-build_docs: &if-label-build_docs if: '$BOT_LABEL_BUILD_DOCS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build_docs(?:,[^,\n\r]+)*$/i'
-
rule: A combination of various patterns, and labels. It will be used by GitLab YAMLextendskeyword to tell GitLab in what conditions will this job be created. For example:.rules:build:docs: rules: - <<: *if-protected - <<: *if-label-build_docs - <<: *if-label-docs - <<: *if-dev-push changes: *patterns-docs
An example for GitLab job on how to use extends:
check_docs_lang_sync: extends: - .pre_check_job_template - .rules:build:docs script: - cd docs - ./check_lang_folder_sync.sh
check if there's a suitable .rules:<rules-you-need> template
- if there is, put this in the job
extends. All done, now you can close this window. (extendscould be array or string) - if there isn't
- check How to Add a New
RulesTemplate?, create a suitable one - follow step 1
- check How to Add a New
check if this rule is related to labels, patterns
- if it is, please refer to dependencies/README.md and add new rules by auto-generating
- if it isn't, please continue reading
check if there's a suitable .if-<if-anchor-you-need> anchor
-
if there is, create a rule following
rulesTemplate Naming Rules.For detail information, please refer to GitLab Documentationrules-if. Here's an example..rules:dev: rules: - <<: *if-trigger - <<: *if-dev-push
-
if there isn't
- check How to Add a New
ifAnchor?, create a suitable one - follow step 1
- check How to Add a New
Create an if anchor following if Anchors Naming Rules. For detailed information about how to write the condition clause, please refer to GitLab Documentation `only/except (advanced). Here's an example.
.if-schedule: &if-schedule:
if: '$CI_PIPELINE_SOURCE == "schedule"'if a phrase has multi words, use _ to concatenate them.
e.g.
regular_test
if a name has multi phrases, use - to concatenate them.
e.g.
regular_test-example_test
-
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 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_testa combination of
example_test,custom_test,unit_test,component_ut,integration_testand all targets
-
- if it's tag related:
.rules:tag:<tag_1>-<tag_2> - if it's label related:
.rules:labels:<label_1>-<label_2> - if it's test related:
.rules:test:<test_type> - if it's build related:
.rules:build:<build_type> - if it's pattern related:
.rules:patterns:<patterns>
It is used to put all the reusable shell scripts 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 them. 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.
add_gitlab_ssh_keysadd_github_ssh_keysadd_doc_server_ssh_keysfetch_submodulesget_all_submodules
error: log in red colorwarning: log in orange colorinfo: log in green colorrun_cmd: run the command with duration seconds inforetry_failed: run the command with duration seconds info, retry when failed