]> granicus.if.org Git - esp-idf/blob - .gitlab-ci.yml
CI: use parallel attribute in CI config file
[esp-idf] / .gitlab-ci.yml
1 stages:
2   - build
3   - assign_test
4   - host_test
5   - target_test
6   - check
7   - deploy
8   - post_check
9
10 variables:
11 # System environment
12
13   # Common parameters for the 'make' during CI tests
14   MAKEFLAGS: "-j5 --no-keep-going"
15
16 # GitLab-CI environment
17
18   # more attempts for more robust
19   GET_SOURCES_ATTEMPTS: "10"
20   ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
21
22   # GIT_STRATEGY is not defined here.
23   # Use an option from  "CI / CD Settings" - "General pipelines".
24
25   # "normal" strategy for fetching only top-level submodules since nothing requires the sub-submodules code for building IDF.
26   # If the "recursive" strategy is used we have a problem with using relative URLs for sub-submodules.
27   GIT_SUBMODULE_STRATEGY: normal
28
29   UNIT_TEST_BUILD_SYSTEM: make
30 # IDF environment
31
32   IDF_PATH: "$CI_PROJECT_DIR"
33   BATCH_BUILD: "1"
34   V: "0"
35   APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
36   CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
37   CUSTOM_TOOLCHAIN_PATH: "/opt/xtensa-custom"
38
39 # Docker images
40   BOT_DOCKER_IMAGE_TAG: ":latest"
41
42 # before each job, we need to check if this job is filtered by bot stage/job filter
43 .apply_bot_filter: &apply_bot_filter
44   python $APPLY_BOT_FILTER_SCRIPT || exit 0
45
46 .setup_custom_toolchain: &setup_custom_toolchain |
47   if [ "$IDF_XTENSA_TOOLCHAIN_URL" ] ; then
48   echo "Use a custom toolchain: ${IDF_XTENSA_TOOLCHAIN_URL:-Unknown}"
49   rm -rf "$CUSTOM_TOOLCHAIN_PATH" &&
50   mkdir -p -v "$CUSTOM_TOOLCHAIN_PATH" &&
51   pushd "$CUSTOM_TOOLCHAIN_PATH" &&
52   curl -sSL -o xtensa-custom.xxx "$IDF_XTENSA_TOOLCHAIN_URL" &&
53   ls -l xtensa-custom.xxx &&
54   tar xf xtensa-custom.xxx --strip-components 1 &&
55   ls -l . &&
56   popd
57   PATH=$CUSTOM_TOOLCHAIN_PATH/bin:$PATH
58   export PATH
59   fi
60
61 .cleanup_custom_toolchain: &cleanup_custom_toolchain |
62   echo "Cleaning up $CUSTOM_TOOLCHAIN_PATH"
63   rm -rf "$CUSTOM_TOOLCHAIN_PATH"
64
65 .setup_tools_unless_target_test: &setup_tools_unless_target_test |
66   if [ "$CI_JOB_STAGE" != "target_test" ]; then
67   tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
68   fi
69
70 .show_submodule_urls: &show_submodule_urls |
71   git config --get-regexp '^submodule\..*\.url$' || true
72
73 before_script:
74   - echo "Running common script"
75   - *show_submodule_urls
76   - source tools/ci/setup_python.sh
77   # apply bot filter in before script
78   - *apply_bot_filter
79   # add gitlab ssh key
80   - mkdir -p ~/.ssh
81   - chmod 700 ~/.ssh
82   - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
83   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
84   - chmod 600 ~/.ssh/id_rsa
85   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
86   # Set some options and environment for CI
87   - source tools/ci/configure_ci_environment.sh
88
89   - *setup_tools_unless_target_test
90
91   - *setup_custom_toolchain
92
93 # used for check scripts which we want to run unconditionally
94 .before_script_lesser_nofilter: &before_script_lesser_nofilter
95   variables:
96     GIT_SUBMODULE_STRATEGY: none
97   before_script:
98     - echo "Not setting up GitLab key, not fetching submodules, not applying bot filter"
99     - source tools/ci/setup_python.sh
100     - source tools/ci/configure_ci_environment.sh
101     - *setup_custom_toolchain
102
103 # used for everything else where we want to do no prep, except for bot filter
104 .before_script_lesser: &before_script_lesser
105   variables:
106     GIT_SUBMODULE_STRATEGY: none
107   before_script:
108     - echo "Not setting up GitLab key, not fetching submodules"
109     - source tools/ci/setup_python.sh
110     # apply bot filter in before script
111     - *apply_bot_filter
112     - source tools/ci/configure_ci_environment.sh
113     - *setup_custom_toolchain
114
115 after_script:
116   - *cleanup_custom_toolchain
117
118 build_template_app:
119   stage: build
120   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
121   tags:
122     - build
123   variables:
124     BATCH_BUILD: "1"
125   only:
126     variables:
127       - $BOT_TRIGGER_WITH_LABEL == null
128       - $BOT_LABEL_BUILD
129       - $BOT_LABEL_REGULAR_TEST
130   script:
131     # Set the variable for 'esp-idf-template' testing
132     - ESP_IDF_TEMPLATE_GIT=${ESP_IDF_TEMPLATE_GIT:-"https://github.com/espressif/esp-idf-template.git"}
133     - git clone ${ESP_IDF_TEMPLATE_GIT}
134     - cd esp-idf-template
135     # Try to use the same branch name for esp-idf-template that we're
136     # using on esp-idf. If it doesn't exist then just stick to the default
137     # branch
138     - python $CHECKOUT_REF_SCRIPT esp-idf-template
139     - make defconfig
140     # Test debug build (default)
141     - make all V=1
142     # Now test release build
143     - make clean
144     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
145     - make all V=1
146     # Check if there are any stray printf/ets_printf references in WiFi libs
147     - cd ../components/esp_wifi/lib_esp32
148     - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
149     - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
150
151
152 .build_template: &build_template
153   stage: build
154   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
155   tags:
156     - build
157   variables:
158     BATCH_BUILD: "1"
159     V: "0"
160
161 build_ssc:
162   <<: *build_template
163   parallel: 3
164   artifacts:
165     paths:
166       - SSC/ssc_bin
167     expire_in: 1 week
168   variables:
169     SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF"
170   only:
171     variables:
172       - $BOT_TRIGGER_WITH_LABEL == null
173       - $BOT_LABEL_BUILD
174       - $BOT_LABEL_INTEGRATION_TEST
175       - $BOT_LABEL_REGULAR_TEST
176   script:
177     - git clone $SSC_REPOSITORY
178     - cd SSC
179     - python $CHECKOUT_REF_SCRIPT SSC
180     - MAKEFLAGS= ./ci_build_ssc.sh
181
182 # If you want to add new build ssc jobs, please add it into dependencies of `assign_test` and `.test_template`
183
184 .build_esp_idf_unit_test_template: &build_esp_idf_unit_test_template
185   <<: *build_template
186   artifacts:
187     paths:
188       - tools/unit-test-app/output
189       - components/idf_test/unit_test/TestCaseAll.yml
190     expire_in: 2 days
191   only:
192     variables:
193       - $BOT_TRIGGER_WITH_LABEL == null
194       - $BOT_LABEL_BUILD
195       - $BOT_LABEL_UNIT_TEST
196       - $BOT_LABEL_REGULAR_TEST
197
198 build_esp_idf_tests_make:
199   <<: *build_esp_idf_unit_test_template
200   script:
201     - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
202     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
203     - cd $CI_PROJECT_DIR/tools/unit-test-app
204     - MAKEFLAGS= make help # make sure kconfig tools are built in single process
205     - make ut-clean-all-configs
206     - make ut-build-all-configs
207     - python tools/UnitTestParser.py
208     # Check if the tests demand Make built binaries. If not, delete them
209     - if [ "$UNIT_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
210     - rm -rf builds output sdkconfig
211     - rm $CI_PROJECT_DIR/components/idf_test/unit_test/TestCaseAll.yml
212
213 build_esp_idf_tests_cmake:
214   <<: *build_esp_idf_unit_test_template
215   script:
216     - export PATH="$IDF_PATH/tools:$PATH"
217     - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
218     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
219     - cd $CI_PROJECT_DIR/tools/unit-test-app
220     - idf.py ut-clean-all-configs
221     - idf.py ut-build-all-configs
222     - python tools/UnitTestParser.py
223     # Check if the tests demand CMake built binaries. If not, delete them
224     - if [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
225     - rm -rf builds output sdkconfig
226     - rm $CI_PROJECT_DIR/components/idf_test/unit_test/TestCaseAll.yml
227
228 build_examples_make:
229   <<: *build_template
230   parallel: 8
231   # This is a workaround for a rarely encountered issue with building examples in CI.
232   # Probably related to building of Kconfig in 'make clean' stage
233   retry: 1
234   artifacts:
235     when: always
236     paths:
237       - build_examples/*/*/*/build/*.bin
238       - build_examples/*/*/*/sdkconfig
239       - build_examples/*/*/*/build/*.elf
240       - build_examples/*/*/*/build/*.map
241       - build_examples/*/*/*/build/download.config
242       - build_examples/*/*/*/build/bootloader/*.bin
243       - $LOG_PATH
244     expire_in: 2 days
245   variables:
246     LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
247   only:
248     variables:
249       - $BOT_TRIGGER_WITH_LABEL == null
250       - $BOT_LABEL_BUILD
251       - $BOT_LABEL_EXAMPLE_TEST
252       - $BOT_LABEL_REGULAR_TEST
253       - $BOT_LABEL_WEEKEND_TEST
254   script:
255     # it's not possible to build 100% out-of-tree and have the "artifacts"
256     # mechanism work, but this is the next best thing
257     - rm -rf build_examples
258     - mkdir build_examples
259     - cd build_examples
260     # build some of examples
261     - mkdir -p ${LOG_PATH}
262     - ${IDF_PATH}/tools/ci/build_examples.sh
263
264 # same as above, but for CMake
265 build_examples_cmake:
266   <<: *build_template
267   parallel: 5
268   artifacts:
269     when: always
270     paths:
271       - build_examples_cmake/*/*/*/build/*.bin
272       - build_examples_cmake/*/*/*/sdkconfig
273       - build_examples_cmake/*/*/*/build/*.elf
274       - build_examples_cmake/*/*/*/build/*.map
275       - build_examples_cmake/*/*/*/build/flasher_args.json
276       - build_examples_cmake/*/*/*/build/bootloader/*.bin
277       - $LOG_PATH
278     expire_in: 2 days
279   variables:
280     LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
281   only:
282     variables:
283       - $BOT_TRIGGER_WITH_LABEL == null
284       - $BOT_LABEL_BUILD
285       - $BOT_LABEL_EXAMPLE_TEST
286       - $BOT_LABEL_REGULAR_TEST
287       - $BOT_LABEL_WEEKEND_TEST
288   script:
289     # it's not possible to build 100% out-of-tree and have the "artifacts"
290     # mechanism work, but this is the next best thing
291     - rm -rf build_examples_cmake
292     - mkdir build_examples_cmake
293     - cd build_examples_cmake
294     # build some of examples
295     - mkdir -p ${LOG_PATH}
296     - ${IDF_PATH}/tools/ci/build_examples_cmake.sh
297
298 # If you want to add new build example jobs, please add it into dependencies of `.example_test_template`
299
300 build_docs:
301   stage: build
302   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
303   tags:
304     - build_docs
305   artifacts:
306     when: always
307     paths:
308       # English version of documentation
309       - docs/en/doxygen-warning-log.txt
310       - docs/en/sphinx-warning-log.txt
311       - docs/en/sphinx-warning-log-sanitized.txt
312       - docs/en/_build/html
313       - docs/sphinx-err-*
314       # Chinese version of documentation
315       - docs/zh_CN/doxygen-warning-log.txt
316       - docs/zh_CN/sphinx-warning-log.txt
317       - docs/zh_CN/sphinx-warning-log-sanitized.txt
318       - docs/zh_CN/_build/html
319     expire_in: 1 day
320   only:
321     variables:
322       - $BOT_TRIGGER_WITH_LABEL == null
323       - $BOT_LABEL_BUILD
324       - $BOT_LABEL_BUILD_DOCS
325       - $BOT_LABEL_REGULAR_TEST
326   script:
327     - cd docs
328     - ./check_lang_folder_sync.sh
329     - cd en
330     - make gh-linkcheck
331     - make html
332     - ../check_doc_warnings.sh
333     - cd ../zh_CN
334     - make gh-linkcheck
335     - make html
336     - ../check_doc_warnings.sh
337
338 .check_job_template: &check_job_template
339   stage: check
340   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
341   tags:
342     - host_test
343   dependencies: []
344   <<: *before_script_lesser_nofilter
345
346 verify_cmake_style:
347   <<: *check_job_template
348   stage: build
349   only:
350     variables:
351       - $BOT_TRIGGER_WITH_LABEL == null
352       - $BOT_LABEL_BUILD
353       - $BOT_LABEL_REGULAR_TEST
354   script:
355     tools/cmake/run_cmake_lint.sh
356
357 .host_test_template: &host_test_template
358   stage: host_test
359   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
360   tags:
361     - host_test
362   dependencies: []
363   only:
364     variables:
365       - $BOT_TRIGGER_WITH_LABEL == null
366       - $BOT_LABEL_HOST_TEST
367       - $BOT_LABEL_REGULAR_TEST
368
369 test_nvs_on_host:
370   <<: *host_test_template
371   script:
372     - cd components/nvs_flash/test_nvs_host
373     - make test
374
375 test_nvs_coverage:
376   <<: *host_test_template
377   artifacts:
378     paths:
379       - components/nvs_flash/test_nvs_host/coverage_report
380     expire_in: 1 week
381   only:
382     refs:
383       - triggers
384     variables:
385       - $BOT_LABEL_NVS_COVERAGE
386   script:
387     - cd components/nvs_flash/test_nvs_host
388     - make coverage_report
389
390 test_partition_table_on_host:
391   <<: *host_test_template
392   tags:
393     - build
394   script:
395     - cd components/partition_table/test_gen_esp32part_host
396     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./gen_esp32part_tests.py
397
398 test_wl_on_host:
399   <<: *host_test_template
400   artifacts:
401     paths:
402       - components/wear_levelling/test_wl_host/coverage_report.zip
403     expire_in: 1 week
404   script:
405     - cd components/wear_levelling/test_wl_host
406     - make test
407
408 test_fatfs_on_host:
409   <<: *host_test_template
410   script:
411     - cd components/fatfs/test_fatfs_host/
412     - make test
413
414 test_ldgen_on_host:
415   <<: *host_test_template
416   script:
417     - cd tools/ldgen/test
418     - ./test_fragments.py
419     - ./test_generation.py
420
421 .host_fuzzer_test_template: &host_fuzzer_test_template
422   stage: host_test
423   image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
424   tags:
425     - host_test
426   dependencies: []
427   artifacts:
428     when: always
429     paths:
430       - ${FUZZER_TEST_DIR}/out/crashes
431       - ${FUZZER_TEST_DIR}/fuzz_output.log
432     expire_in: 1 week
433   only:
434     variables:
435       - $BOT_LABEL_FUZZER_TEST
436       - $BOT_LABEL_WEEKEND_TEST
437   script:
438     - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
439     - cd ${FUZZER_TEST_DIR}
440     # run AFL fuzzer for one hour
441     - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
442     - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
443     # check no crashes found
444     - test -z "$(ls out/crashes/)" || exit 1
445
446 .clang_tidy_check_template: &clang_tidy_check_template
447   stage: host_test
448   image: ${CI_DOCKER_REGISTRY}/clang-static-analysis
449   tags:
450     - host_test
451   dependencies: []
452   artifacts:
453     reports:
454       junit: $IDF_PATH/output.xml
455     when: always
456     paths:
457       - $IDF_PATH/examples/get-started/hello_world/tidybuild/report/*
458     expire_in: 1 day
459   script:
460     - git clone $IDF_ANALYSIS_UTILS static_analysis_utils && cd static_analysis_utils
461     # Setup parameters of triggered/regular job
462     - export TRIGGERED_RELATIVE=${BOT_LABEL_STATIC_ANALYSIS-} && export TRIGGERED_ABSOLUTE=${BOT_LABEL_STATIC_ANALYSIS_ALL-} && export TARGET_BRANCH=${BOT_CUSTOMIZED_REVISION-}
463     - ./analyze.sh $IDF_PATH/examples/get-started/hello_world/ $IDF_PATH/tools/ci/static-analysis-rules.yml $IDF_PATH/output.xml
464
465 .clang_tidy_deploy_template: &clang_tidy_deploy_template
466   stage: deploy
467   image: $CI_DOCKER_REGISTRY/esp32-ci-env
468   tags:
469     - deploy
470   script:
471     - mkdir -p ~/.ssh
472     - chmod 700 ~/.ssh
473     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
474     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
475     - chmod 600 ~/.ssh/id_rsa
476     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
477     - export GIT_VER=$(git describe --always)
478     - cd $IDF_PATH/examples/get-started/hello_world/tidybuild
479     - mv report $GIT_VER
480     - tar czvf $GIT_VER.tar.gz $GIT_VER
481     - export STATIC_REPORT_PATH="web/static_analysis/esp-idf/"
482     - ssh $DOCS_SERVER -x "mkdir -p $STATIC_REPORT_PATH/clang-tidy"
483     - scp $GIT_VER.tar.gz $DOCS_SERVER:$STATIC_REPORT_PATH/clang-tidy
484     - ssh $DOCS_SERVER -x "cd $STATIC_REPORT_PATH/clang-tidy && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
485     # add link to view the report
486     - echo "[static analysis][clang tidy] $CI_DOCKER_REGISTRY/static_analysis/esp-idf/clang-tidy/${GIT_VER}/index.html"
487     - test ! -e ${GIT_VER}/FAILED_RULES || { echo 'Failed static analysis rules!'; cat ${GIT_VER}/FAILED_RULES; exit 1; }
488
489 clang_tidy_check:
490   <<: *clang_tidy_check_template
491   variables:
492     BOT_NEEDS_TRIGGER_BY_NAME: 1
493     BOT_LABEL_STATIC_ANALYSIS: 1
494
495 clang_tidy_check_regular:
496   <<: *clang_tidy_check_template
497
498 clang_tidy_check_all:
499   <<: *clang_tidy_check_template
500   variables:
501     BOT_NEEDS_TRIGGER_BY_NAME: 1
502     BOT_LABEL_STATIC_ANALYSIS_ALL: 1
503
504 clang_tidy_deploy:
505   <<: *clang_tidy_deploy_template
506   dependencies:
507     - clang_tidy_check
508     - clang_tidy_check_all
509   variables:
510     BOT_NEEDS_TRIGGER_BY_NAME: 1
511
512 clang_tidy_deploy_regular:
513   <<: *clang_tidy_deploy_template
514   dependencies:
515     - clang_tidy_check_regular
516   only:
517     refs:
518       - master
519       - /^release\/v/
520       - /^v\d+\.\d+(\.\d+)?($|-)/
521       - triggers
522       - schedules
523     variables:
524       - $BOT_LABEL_STATIC_ANALYSIS
525       - $BOT_LABEL_STATIC_ANALYSIS_ALL
526
527 test_mdns_fuzzer_on_host:
528   <<: *host_fuzzer_test_template
529   variables:
530     FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
531
532 test_lwip_dns_fuzzer_on_host:
533   <<: *host_fuzzer_test_template
534   variables:
535     FUZZER_TEST_DIR: components/lwip/test_afl_host
536     FUZZER_PARAMS: MODE=dns
537
538 test_lwip_dhcp_fuzzer_on_host:
539   <<: *host_fuzzer_test_template
540   variables:
541     FUZZER_TEST_DIR: components/lwip/test_afl_host
542     FUZZER_PARAMS: MODE=dhcp_client
543
544 test_lwip_dhcps_fuzzer_on_host:
545   <<: *host_fuzzer_test_template
546   variables:
547     FUZZER_TEST_DIR: components/lwip/test_afl_host
548     FUZZER_PARAMS: MODE=dhcp_server
549
550 test_spiffs_on_host:
551   <<: *host_test_template
552   script:
553     - cd components/spiffs/test_spiffs_host/
554     - make test
555
556 test_multi_heap_on_host:
557   <<: *host_test_template
558   script:
559     - cd components/heap/test_multi_heap_host
560     - ./test_all_configs.sh
561
562 test_confserver:
563   <<: *host_test_template
564   script:
565     - cd tools/kconfig_new/test
566     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
567
568 test_build_system:
569   <<: *host_test_template
570   script:
571     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
572     - rm -rf test_build_system
573     - mkdir test_build_system
574     - cd test_build_system
575     - ${IDF_PATH}/tools/ci/test_build_system.sh
576
577 test_build_system_cmake:
578   <<: *host_test_template
579   script:
580     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
581     - rm -rf test_build_system
582     - mkdir test_build_system
583     - cd test_build_system
584     - ${IDF_PATH}/tools/ci/test_build_system_cmake.sh
585
586 test_idf_monitor:
587   <<: *host_test_template
588   artifacts:
589     # save artifacts always in order to access results which were retried without consequent failure
590     when: always
591     paths:
592       - tools/test_idf_monitor/outputs/*
593     expire_in: 1 week
594   script:
595     - cd ${IDF_PATH}/tools/test_idf_monitor
596     - ./run_test_idf_monitor.py
597
598 test_idf_size:
599   <<: *host_test_template
600   artifacts:
601     when: on_failure
602     paths:
603       - tools/test_idf_size/output
604       - tools/test_idf_size/.coverage
605     expire_in: 1 week
606   script:
607     - cd ${IDF_PATH}/tools/test_idf_size
608     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
609
610 test_idf_tools:
611   <<: *host_test_template
612   script:
613     # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
614     - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif${CUSTOM_TOOLCHAIN_PATH:+\|${CUSTOM_TOOLCHAIN_PATH}}" | tr "\n" ":"); echo ${p%:})
615     - cd ${IDF_PATH}/tools/test_idf_tools
616     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_idf_tools.py
617
618 test_esp_err_to_name_on_host:
619   <<: *host_test_template
620   artifacts:
621     when: on_failure
622     paths:
623       - components/esp32/esp_err_to_name.c
624     expire_in: 1 week
625   script:
626     - cd ${IDF_PATH}/tools/
627     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
628     - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || { echo 'Differences found. Please run gen_esp_err_to_name.py and commit the changes.'; exit 1; }
629     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
630     - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
631
632 test_esp_efuse_table_on_host:
633   <<: *host_test_template
634   artifacts:
635     when: on_failure
636     paths:
637       - components/efuse/esp32/esp_efuse_table.c
638     expire_in: 1 week
639   script:
640     - cd ${IDF_PATH}/components/efuse/
641     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py ${IDF_PATH}/components/efuse/esp32/esp_efuse_table.csv
642     - git diff --exit-code -- esp32/esp_efuse_table.c || { echo 'Differences found. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
643     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py ${IDF_PATH}/components/efuse/esp32/esp_efuse_table.csv
644     - git diff --exit-code -- ../components/esp32/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
645     - cd ${IDF_PATH}/components/efuse/test_efuse_host
646     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
647
648 test_espcoredump:
649   <<: *host_test_template
650   artifacts:
651     when: always
652     paths:
653       - components/espcoredump/test/.coverage
654       - components/espcoredump/test/output
655     expire_in: 1 week
656   script:
657     - cd components/espcoredump/test/
658     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
659
660 test_logtrace_proc:
661   <<: *host_test_template
662   artifacts:
663     when: on_failure
664     paths:
665       - tools/esp_app_trace/test/logtrace/output
666       - tools/esp_app_trace/test/logtrace/.coverage
667     expire_in: 1 week
668   script:
669     - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
670     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
671
672 test_sysviewtrace_proc:
673   <<: *host_test_template
674   artifacts:
675     when: on_failure
676     paths:
677       - tools/esp_app_trace/test/sysview/output
678       - tools/esp_app_trace/test/sysview/.coverage
679     expire_in: 1 week
680   script:
681     - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
682     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
683
684 push_to_github:
685   stage: deploy
686   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
687   tags:
688     - deploy
689   only:
690     - master
691     - /^release\/v/
692     - /^v\d+\.\d+(\.\d+)?($|-)/
693   when: on_success
694   dependencies: []
695   <<: *before_script_lesser
696   script:
697     - mkdir -p ~/.ssh
698     - chmod 700 ~/.ssh
699     - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
700     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
701     - chmod 600 ~/.ssh/id_rsa
702     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
703     - git remote remove github &>/dev/null || true
704     - git remote add github git@github.com:espressif/esp-idf.git
705     - tools/ci/push_to_github.sh
706
707 deploy_docs:
708   stage: deploy
709   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
710   tags:
711     - deploy
712   only:
713     refs:
714       - master
715       - /^release\/v/
716       - /^v\d+\.\d+(\.\d+)?($|-)/
717       - triggers
718     variables:
719       - $BOT_TRIGGER_WITH_LABEL == null
720       - $BOT_LABEL_BUILD_DOCS
721   dependencies:
722     - build_docs
723   <<: *before_script_lesser
724   script:
725     - mkdir -p ~/.ssh
726     - chmod 700 ~/.ssh
727     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
728     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
729     - chmod 600 ~/.ssh/id_rsa
730     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
731     - export GIT_VER=$(git describe --always)
732     - cd docs/en/_build/
733     - mv html $GIT_VER
734     - tar czvf $GIT_VER.tar.gz $GIT_VER
735     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
736     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
737     - cd ../../zh_CN/_build/
738     - mv html $GIT_VER
739     - tar czvf $GIT_VER.tar.gz $GIT_VER
740     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
741     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
742     # add link to preview doc
743     - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
744     - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
745
746 update_test_cases:
747   stage: assign_test
748   image: $CI_DOCKER_REGISTRY/ubuntu-test-env
749   tags:
750     - deploy_test
751   only:
752     refs:
753       - master
754       - schedules
755     variables:
756       - $DEPLOY_TEST_RESULT_TO_JIRA == "Yes"
757   dependencies:
758     - build_esp_idf_tests_make
759     - build_esp_idf_tests_cmake
760   artifacts:
761     when: always
762     paths:
763       - ${CI_PROJECT_DIR}/test-management/*.log
764     expire_in: 1 week
765   variables:
766     UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
767     BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
768     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
769     AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
770     PYTHON_VER: 3
771   script:
772     - export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
773     - git clone $TEST_MANAGEMENT_REPO
774     - cd test-management
775     - python $CHECKOUT_REF_SCRIPT test-management
776     - echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
777     # update unit test cases
778     - python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILE -r $GIT_SHA
779     # update example test cases
780     - python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/examples -r $GIT_SHA
781     # organize test cases
782     - python OrganizeTestCases.py $JIRA_TEST_MANAGEMENT_PROJECT
783
784 deploy_test_result:
785   stage: deploy
786   image: $CI_DOCKER_REGISTRY/bot-env
787   tags:
788     - deploy_test
789   when: always
790   only:
791     refs:
792       - master
793       - schedules
794     variables:
795       - $DEPLOY_TEST_RESULT_TO_JIRA == "Yes"
796   artifacts:
797     when: always
798     paths:
799       - ${CI_PROJECT_DIR}/test-management/*.log
800       # save all test logs as artifacts, make it easier to track errors
801       - ${CI_PROJECT_DIR}/TEST_LOGS
802       - $CI_PROJECT_DIR/$CI_COMMIT_SHA
803     expire_in: 1 mos
804   variables:
805     UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test/TestCaseAll.yml"
806     BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
807     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
808     AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
809   before_script:
810     - mkdir -p ~/.ssh
811     - chmod 700 ~/.ssh
812     - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
813     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
814     - chmod 600 ~/.ssh/id_rsa
815     - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
816   script:
817     - export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
818     - export REV_COUNT=$(git rev-list --count HEAD)
819     - export SUMMARY="IDF CI test result for $GIT_SHA (r${REV_COUNT})"
820     # artifacts of job update_test_cases creates test-management folder
821     # we need to remove it so we can clone test-management folder again
822     - rm -r test-management
823     - git clone $TEST_MANAGEMENT_REPO
824     - cd test-management
825     - python3 $CHECKOUT_REF_SCRIPT test-management
826     - echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
827     # update test results
828     - python3 ImportTestResult.py -r "$GIT_SHA (r${REV_COUNT})" -j $JIRA_TEST_MANAGEMENT_PROJECT -s "$SUMMARY" -l CI -p ${CI_PROJECT_DIR}/TEST_LOGS ${CI_PROJECT_DIR}/${CI_COMMIT_SHA} --pipeline_url ${CI_PIPELINE_URL}
829
830 check_doc_links:
831   stage: host_test
832   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
833   tags:
834     - check_doc_links
835   only:
836     refs:
837       # can only be triggered
838       - triggers
839     variables:
840       - $BOT_TRIGGER_WITH_LABEL == null
841       - $BOT_LABEL_BUILD_DOCS
842   artifacts:
843     paths:
844       - docs/_build/linkcheck
845     expire_in: 1 week
846   script:
847     # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
848     - test "$CHECK_LINKS" = "Yes" || exit 0
849     # can only run on master branch (otherwise the commit is not on Github yet)
850     - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
851     - cd docs
852     - make linkcheck
853
854 check_line_endings:
855   <<: *check_job_template
856   script:
857     - tools/ci/check-line-endings.sh ${IDF_PATH}
858
859 check_commit_msg:
860   <<: *check_job_template
861   script:
862     - git status
863     - git log -n10 --oneline
864     # commit start with "WIP: " need to be squashed before merge
865     - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
866
867 check_permissions:
868   <<: *check_job_template
869   script:
870     - tools/ci/check-executable.sh
871
872 check_version:
873   <<: *check_job_template
874   # Don't run this for feature/bugfix branches, so that it is possible to modify
875   # esp_idf_version.h in a branch before tagging the next version.
876   only:
877     - master
878     - /^release\/v/
879     - /^v\d+\.\d+(\.\d+)?($|-)/
880   script:
881     - export IDF_PATH=$PWD
882     - tools/ci/check_idf_version.sh
883
884 check_examples_cmake_make:
885   <<: *check_job_template
886   except:
887     - master
888     - /^release\/v/
889     - /^v\d+\.\d+(\.\d+)?($|-)/
890   <<: *before_script_lesser
891   script:
892     - tools/ci/check_examples_cmake_make.sh
893
894 check_python_style:
895   <<: *check_job_template
896   artifacts:
897     when: on_failure
898     paths:
899       - flake8_output.txt
900     expire_in: 1 week
901   <<: *before_script_lesser
902   script:
903     # run it only under Python 3 (it is very slow under Python 2)
904     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH
905
906 check_kconfigs:
907   <<: *check_job_template
908   artifacts:
909     when: on_failure
910     paths:
911       - components/*/Kconfig*.new
912       - examples/*/*/*/Kconfig*.new
913       - examples/*/*/*/*/Kconfig*.new
914       - tools/*/Kconfig*.new
915       - tools/*/*/Kconfig*.new
916       - tools/*/*/*/Kconfig*.new
917     expire_in: 1 week
918   <<: *before_script_lesser
919   script:
920     - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ${IDF_PATH}/tools/test_check_kconfigs.py
921     - ${IDF_PATH}/tools/check_kconfigs.py
922
923 check_ut_cmake_make:
924   stage: check
925   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
926   tags:
927     - build
928   except:
929     - master
930     - /^release\/v/
931     - /^v\d+\.\d+(\.\d+)?($|-)/
932   dependencies: []
933   <<: *before_script_lesser
934   script:
935     - tools/ci/check_ut_cmake_make.sh
936
937 check_submodule_sync:
938   <<: *check_job_template
939   tags:
940     - github_sync
941   retry: 2
942   variables:
943     GIT_STRATEGY: clone
944     GIT_SUBMODULE_STRATEGY: none
945     PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
946   before_script: []
947   after_script: []
948   script:
949     - git submodule deinit --force .
950     # setting the default remote URL to the public one, to resolve relative location URLs
951     - git config remote.origin.url ${PUBLIC_IDF_URL}
952     # check if all submodules are correctly synced to public repostory
953     - git submodule init
954     - *show_submodule_urls
955     - git submodule update --recursive
956     - echo "IDF was cloned from ${PUBLIC_IDF_URL} completely"
957
958 check_artifacts_expire_time:
959   <<: *check_job_template
960   script:
961     # check if we have set expire time for all artifacts
962     - python tools/ci/check_artifacts_expire_time.py
963
964 check_pipeline_triggered_by_label:
965   <<: *check_job_template
966   stage: post_check
967   only:
968     variables:
969       - $BOT_TRIGGER_WITH_LABEL
970   script:
971     # If the pipeline is triggered with label, the pipeline will only succeeded if "regular_test" label is added.
972     # We want to make sure some jobs are always executed to detect regression.
973     - test "$BOT_LABEL_REGULAR_TEST" = "true" || { echo "CI can only pass if 'regular_test' label is included"; exit -1; }
974
975 assign_test:
976   tags:
977     - assign_test
978   image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
979   stage: assign_test
980   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
981   # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
982   dependencies:
983     - build_ssc
984     - build_esp_idf_tests_make
985     - build_esp_idf_tests_cmake
986   variables:
987     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
988     EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
989   artifacts:
990     paths:
991       - components/idf_test/*/CIConfigs
992       - components/idf_test/*/TC.sqlite
993       - $EXAMPLE_CONFIG_OUTPUT_PATH
994     expire_in: 1 week
995   only:
996     variables:
997       - $BOT_TRIGGER_WITH_LABEL == null
998       - $BOT_LABEL_UNIT_TEST
999       - $BOT_LABEL_INTEGRATION_TEST
1000       - $BOT_LABEL_EXAMPLE_TEST
1001   script:
1002     # assign example tests
1003     - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
1004     # assign unit test cases
1005     - python $TEST_FW_PATH/CIAssignUnitTest.py $IDF_PATH/components/idf_test/unit_test/TestCaseAll.yml $IDF_PATH/.gitlab-ci.yml $IDF_PATH/components/idf_test/unit_test/CIConfigs
1006     # clone test script to assign tests
1007     - git clone $TEST_SCRIPT_REPOSITORY
1008     - cd auto_test_script
1009     - python $CHECKOUT_REF_SCRIPT auto_test_script
1010     # assgin integration test cases
1011     - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
1012
1013 .example_test_template: &example_test_template
1014   stage: target_test
1015   when: on_success
1016   only:
1017     refs:
1018       - master
1019       - /^release\/v/
1020       - /^v\d+\.\d+(\.\d+)?($|-)/
1021       - triggers
1022       - schedules
1023     variables:
1024       - $BOT_TRIGGER_WITH_LABEL == null
1025       - $BOT_LABEL_EXAMPLE_TEST
1026   dependencies:
1027     - assign_test
1028     - build_examples_make
1029     - build_examples_cmake
1030   artifacts:
1031     when: always
1032     paths:
1033       - $LOG_PATH
1034     expire_in: 1 week
1035     reports:
1036         junit: $LOG_PATH/*/XUNIT_RESULT.xml
1037   variables:
1038     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
1039     TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
1040     CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME_$CI_NODE_INDEX.yml"
1041     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
1042     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
1043   script:
1044     # first test if config file exists, if not exist, exit 0
1045     - test -e $CONFIG_FILE || exit 0
1046     # clone test env configs
1047     - git clone $TEST_ENV_CONFIG_REPOSITORY
1048     - cd ci-test-runner-configs
1049     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
1050     - cd $TEST_FW_PATH
1051     # run test
1052     - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
1053
1054 .unit_test_template: &unit_test_template
1055   <<: *example_test_template
1056   stage: target_test
1057   dependencies:
1058     - assign_test
1059     - build_esp_idf_tests_make
1060     - build_esp_idf_tests_cmake
1061   only:
1062     refs:
1063       - master
1064       - /^release\/v/
1065       - /^v\d+\.\d+(\.\d+)?($|-)/
1066       - triggers
1067       - schedules
1068     variables:
1069       - $BOT_TRIGGER_WITH_LABEL == null
1070       - $BOT_LABEL_UNIT_TEST
1071   variables:
1072     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
1073     TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
1074     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME_$CI_NODE_INDEX.yml"
1075     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
1076     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
1077
1078 test_weekend_mqtt:
1079   <<: *example_test_template
1080   stage: target_test
1081   tags:
1082     - ESP32
1083     - Example_WIFI
1084   only:
1085     variables:
1086       - $BOT_LABEL_WEEKEND_TEST
1087   variables:
1088     TEST_CASE_PATH: "$CI_PROJECT_DIR/components/mqtt/weekend_test"
1089     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
1090     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
1091     ENV_FILE: "$CI_PROJECT_DIR/components/mqtt/weekend_test/env.yml"
1092     CONFIG_FILE: "$CI_PROJECT_DIR/components/mqtt/weekend_test/config.yml"
1093
1094 test_weekend_network:
1095   <<: *example_test_template
1096   stage: target_test
1097   image: $CI_DOCKER_REGISTRY/rpi-net-suite$BOT_DOCKER_IMAGE_TAG
1098   tags:
1099     - ESP32
1100     - Example_WIFI
1101   only:
1102     variables:
1103       - $BOT_LABEL_WEEKEND_TEST
1104   variables:
1105     TEST_CASE_PATH: "$CI_PROJECT_DIR/components/lwip/weekend_test"
1106     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
1107     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
1108     ENV_FILE: "$CI_PROJECT_DIR/components/lwip/weekend_test/env.yml"
1109     CONFIG_FILE: "$CI_PROJECT_DIR/components/lwip/weekend_test/config.yml"
1110
1111 .test_template: &test_template
1112   stage: target_test
1113   when: on_success
1114   only:
1115     refs:
1116       - master
1117       - /^release\/v/
1118       - /^v\d+\.\d+(\.\d+)?($|-)/
1119       - triggers
1120       - schedules
1121     variables:
1122       - $BOT_TRIGGER_WITH_LABEL == null
1123       - $BOT_LABEL_INTEGRATION_TEST
1124   dependencies:
1125     - assign_test
1126     - build_ssc
1127   artifacts:
1128     when: always
1129     reports:
1130         junit: $LOG_PATH/*/XUNIT_RESULT.xml
1131     paths:
1132       - $LOG_PATH
1133     expire_in: 1 week
1134   variables:
1135     GIT_SUBMODULE_STRATEGY: none
1136     LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
1137     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
1138     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
1139     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
1140     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME_$CI_NODE_INDEX.yml"
1141   script:
1142     # first test if config file exists, if not exist, exit 0
1143     - test -e $CONFIG_FILE || exit 0
1144     # clone local test env configs
1145     - git clone $TEST_ENV_CONFIG_REPOSITORY
1146     - cd ci-test-runner-configs
1147     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
1148     # clone test bench
1149     - git clone $TEST_SCRIPT_REPOSITORY
1150     - cd auto_test_script
1151     - python $CHECKOUT_REF_SCRIPT auto_test_script
1152     # run test
1153     - python CIRunner.py -l "$LOG_PATH/$CI_JOB_NAME_$CI_NODE_INDEX" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH -m $MODULE_UPDATE_FILE
1154
1155 nvs_compatible_test:
1156   <<: *test_template
1157   artifacts:
1158     when: always
1159     paths:
1160       - $LOG_PATH
1161       - nvs_wifi.bin
1162     expire_in: 1 mos
1163   tags:
1164     - ESP32_IDF
1165     - NVS_Compatible
1166   script:
1167     # clone local test env configs
1168     - git clone $TEST_ENV_CONFIG_REPOSITORY
1169     - cd ci-test-runner-configs
1170     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
1171     # clone test bench
1172     - git clone $TEST_SCRIPT_REPOSITORY
1173     - cd auto_test_script
1174     - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
1175     # prepare nvs bins
1176     - ./Tools/prepare_nvs_bin.sh
1177     # run test
1178     - python CIRunner.py -l "$LOG_PATH/$CI_JOB_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH -m $MODULE_UPDATE_FILE
1179
1180 example_test_001:
1181   <<: *example_test_template
1182   parallel: 2
1183   tags:
1184     - ESP32
1185     - Example_WIFI
1186
1187 example_test_002:
1188   <<: *example_test_template
1189   image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
1190   tags:
1191     - ESP32
1192     - Example_ShieldBox_Basic
1193
1194 .example_test_003:
1195   <<: *example_test_template
1196   tags:
1197     - ESP32
1198     - Example_SDIO
1199
1200 example_test_004:
1201   <<: *example_test_template
1202   tags:
1203     - ESP32
1204     - Example_CAN
1205
1206 example_test_005:
1207   <<: *example_test_template
1208   tags:
1209     - ESP32
1210     - Example_WIFI_BT
1211
1212 example_test_006:
1213   <<: *example_test_template
1214   image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
1215   only:
1216     variables:
1217       - $BOT_LABEL_IPERF_STRESS_TEST
1218   tags:
1219     - ESP32
1220     - Example_ShieldBox
1221
1222 example_test_007:
1223   <<: *example_test_template
1224   tags:
1225     - ESP32
1226     - Example_I2C_CCS811_SENSOR
1227
1228 UT_001:
1229   <<: *unit_test_template
1230   parallel: 50
1231   tags:
1232     - ESP32_IDF
1233     - UT_T1_1
1234
1235 UT_002:
1236   <<: *unit_test_template
1237   parallel: 18
1238   tags:
1239     - ESP32_IDF
1240     - UT_T1_1
1241     - psram
1242
1243 UT_003:
1244   <<: *unit_test_template
1245   parallel: 3
1246   tags:
1247     - ESP32_IDF
1248     - UT_T1_SDMODE
1249
1250 UT_004:
1251   <<: *unit_test_template
1252   parallel: 3
1253   tags:
1254     - ESP32_IDF
1255     - UT_T1_SPIMODE
1256
1257 UT_005:
1258   <<: *unit_test_template
1259   tags:
1260     - ESP32_IDF
1261     - UT_T1_SDMODE
1262     - psram
1263
1264 UT_006:
1265   <<: *unit_test_template
1266   tags:
1267     - ESP32_IDF
1268     - UT_T1_SPIMODE
1269     - psram
1270
1271 UT_007:
1272   <<: *unit_test_template
1273   parallel: 4
1274   tags:
1275     - ESP32_IDF
1276     - UT_T1_GPIO
1277
1278 UT_008:
1279   <<: *unit_test_template
1280   tags:
1281     - ESP32_IDF
1282     - UT_T1_GPIO
1283     - psram
1284
1285 UT_009:
1286   <<: *unit_test_template
1287   parallel: 4
1288   tags:
1289     - ESP32_IDF
1290     - UT_T1_PCNT
1291
1292 UT_010:
1293   <<: *unit_test_template
1294   tags:
1295     - ESP32_IDF
1296     - UT_T1_PCNT
1297     - psram
1298
1299 UT_011:
1300   <<: *unit_test_template
1301   parallel: 4
1302   tags:
1303     - ESP32_IDF
1304     - UT_T1_LEDC
1305
1306 UT_012:
1307   <<: *unit_test_template
1308   tags:
1309     - ESP32_IDF
1310     - UT_T1_LEDC
1311     - psram
1312
1313 UT_013:
1314   <<: *unit_test_template
1315   parallel: 4
1316   tags:
1317     - ESP32_IDF
1318     - UT_T2_RS485
1319
1320 UT_014:
1321   <<: *unit_test_template
1322   tags:
1323     - ESP32_IDF
1324     - UT_T2_RS485
1325     - psram
1326
1327 UT_015:
1328   <<: *unit_test_template
1329   parallel: 4
1330   tags:
1331     - ESP32_IDF
1332     - UT_T1_RMT
1333
1334 UT_016:
1335   <<: *unit_test_template
1336   tags:
1337     - ESP32_IDF
1338     - UT_T1_RMT
1339     - psram
1340
1341 UT_017:
1342   <<: *unit_test_template
1343   parallel: 3
1344   tags:
1345     - ESP32_IDF
1346     - EMMC
1347
1348 UT_018:
1349   <<: *unit_test_template
1350   parallel: 5
1351   tags:
1352     - ESP32_IDF
1353     - UT_T1_1
1354     - 8Mpsram
1355
1356 UT_019:
1357   <<: *unit_test_template
1358   parallel: 4
1359   tags:
1360     - ESP32_IDF
1361     - Example_SPI_Multi_device
1362
1363 UT_020:
1364   <<: *unit_test_template
1365   tags:
1366     - ESP32_IDF
1367     - Example_SPI_Multi_device
1368     - psram
1369
1370 UT_021:
1371   <<: *unit_test_template
1372   parallel: 4
1373   tags:
1374     - ESP32_IDF
1375     - UT_T2_I2C
1376
1377 UT_022:
1378   <<: *unit_test_template
1379   tags:
1380     - ESP32_IDF
1381     - UT_T2_I2C
1382     - psram
1383
1384 UT_023:
1385   <<: *unit_test_template
1386   parallel: 4
1387   tags:
1388     - ESP32_IDF
1389     - UT_T1_MCPWM
1390
1391 UT_024:
1392   <<: *unit_test_template
1393   tags:
1394     - ESP32_IDF
1395     - UT_T1_MCPWM
1396     - psram
1397
1398 UT_025:
1399   <<: *unit_test_template
1400   parallel: 4
1401   tags:
1402     - ESP32_IDF
1403     - UT_T1_I2S
1404
1405 UT_026:
1406   <<: *unit_test_template
1407   tags:
1408     - ESP32_IDF
1409     - UT_T1_I2S
1410     - psram
1411
1412 UT_027:
1413   <<: *unit_test_template
1414   parallel: 3
1415   tags:
1416     - ESP32_IDF
1417     - UT_T2_1
1418
1419 UT_028:
1420   <<: *unit_test_template
1421   tags:
1422     - ESP32_IDF
1423     - UT_T2_1
1424     - psram
1425
1426 UT_029:
1427   <<: *unit_test_template
1428   tags:
1429     - ESP32_IDF
1430     - UT_T2_1
1431     - 8Mpsram
1432
1433 UT_030:
1434   <<: *unit_test_template
1435   parallel: 5
1436   tags:
1437     - ESP32_IDF
1438     - UT_T1_1
1439
1440 IT_001:
1441   <<: *test_template
1442   parallel: 3
1443   tags:
1444     - ESP32_IDF
1445     - SSC_T1_4
1446
1447 IT_002:
1448   <<: *test_template
1449   tags:
1450     - ESP32_IDF
1451     - SSC_T1_2
1452
1453 IT_003:
1454   <<: *test_template
1455   parallel: 13
1456   tags:
1457     - ESP32_IDF
1458     - SSC_T2_5
1459
1460 IT_004:
1461   <<: *test_template
1462   tags:
1463     - ESP32_IDF
1464     - SSC_T1_APC
1465
1466 IT_005:
1467   <<: *test_template
1468   parallel: 2
1469   tags:
1470     - ESP32_IDF
1471     - SSC_T1_5
1472
1473 IT_006:
1474   <<: *test_template
1475   parallel: 8
1476   tags:
1477     - ESP32_IDF
1478     - SSC_T1_6
1479
1480 IT_007:
1481   <<: *test_template
1482   parallel: 3
1483   tags:
1484     - ESP32_IDF
1485     - SSC_T1_7
1486
1487 IT_008:
1488   <<: *test_template
1489   tags:
1490     - ESP32_IDF
1491     - SSC_T1_8
1492
1493 IT_009:
1494   <<: *test_template
1495   tags:
1496     - ESP32_IDF
1497     - SSC_T1_3
1498
1499 IT_010:
1500   <<: *test_template
1501   parallel: 4
1502   tags:
1503     - ESP32_IDF
1504     - SSC_T5_1
1505
1506 IT_011:
1507   <<: *test_template
1508   tags:
1509     - ESP32_IDF
1510     - SSC_T1_MESH1
1511
1512 IT_012:
1513   <<: *test_template
1514   parallel: 2
1515   tags:
1516     - ESP32_IDF
1517     - SSC_T2_MESH1
1518
1519 IT_013:
1520   <<: *test_template
1521   tags:
1522     - ESP32_IDF
1523     - SSC_T3_MESH1
1524
1525 IT_014:
1526   <<: *test_template
1527   tags:
1528     - ESP32_IDF
1529     - SSC_T6_MESH1
1530
1531 IT_015:
1532   <<: *test_template
1533   tags:
1534     - ESP32_IDF
1535     - SSC_T12_MESH1
1536
1537 IT_016:
1538   <<: *test_template
1539   tags:
1540     - ESP32_IDF
1541     - SSC_T50_MESH1
1542
1543 IT_017:
1544   <<: *test_template
1545   tags:
1546     - ESP32_IDF
1547     - SSC_T1_MESH2
1548
1549 IT_018:
1550   <<: *test_template
1551   parallel: 2
1552   tags:
1553     - ESP32_IDF
1554     - SSC_T1_9
1555
1556 IT_019:
1557   <<: *test_template
1558   parallel: 2
1559   tags:
1560     - ESP32_IDF
1561     - SSC_T2_2
1562
1563 IT_020:
1564   <<: *test_template
1565   tags:
1566     - ESP32_IDF
1567     - SSC_T2_3
1568
1569 IT_021:
1570   <<: *test_template
1571   tags:
1572     - ESP32_IDF
1573     - SSC_T2_4