]> granicus.if.org Git - esp-idf/blob - .gitlab-ci.yml
tools: support python3 in gen_esp_err_to_name.py
[esp-idf] / .gitlab-ci.yml
1 stages:
2   - build
3   - assign_test
4   - host_test
5   - unit_test
6   - integration_test
7   - deploy
8
9 variables:
10 # System environment
11
12   # Common parameters for the 'make' during CI tests
13   MAKEFLAGS: "-j5 --no-keep-going"
14
15 # GitLab-CI environment
16
17   # more attempts for more robust
18   GET_SOURCES_ATTEMPTS: "10"
19   ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
20
21   # We use get_sources.sh script to fetch the submodules and/or re-fetch the repo
22   # if it was corrupted (if submodule update fails this can happen)
23   GIT_STRATEGY: fetch
24   GIT_SUBMODULE_STRATEGY: none
25
26 # IDF environment
27
28   IDF_PATH: "$CI_PROJECT_DIR"
29   BATCH_BUILD: "1"
30   V: "0"
31   APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
32   CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
33
34 # When 'fetch' strategy is used, Gitlab removes untracked files before checking out
35 # new revision. However if the new revision doesn't include some of the submodules
36 # which were present in the old revision, such submodule directories would not be
37 # removed by the checkout. This extra step ensures that these stale submodules
38 # are removed.
39 .git_clean_stale_submodules:  &git_clean_stale_submodules >
40   find . -name '.git' -not -path './.git' -printf '%P\n'
41   | sed 's|/.git||' 
42   | xargs -I {} sh -c '
43   grep -q {} .gitmodules 
44   ||  (echo "Removing {}, has .git directory but not in .gitmodules file" 
45   && rm -rf {});'
46
47 # before each job, we need to check if this job is filtered by bot stage/job filter
48 .apply_bot_filter: &apply_bot_filter
49   python $APPLY_BOT_FILTER_SCRIPT || exit 0
50
51 before_script:
52   - *git_clean_stale_submodules
53   # apply bot filter in before script
54   - *apply_bot_filter
55   # add gitlab ssh key
56   - mkdir -p ~/.ssh
57   - chmod 700 ~/.ssh
58   - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
59   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
60   - chmod 600 ~/.ssh/id_rsa
61   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
62
63   # Set IS_PRIVATE or IS_PUBLIC depending on if our branch is public or not
64   #
65   # (the same regular expressions are used to set these are used in 'only:' sections below
66   - source tools/ci/configure_ci_environment.sh
67
68   # fetch the submodules (& if necessary re-fetch repo) from gitlab
69   - time ./tools/ci/get-full-sources.sh
70
71 .do_nothing_before:
72   before_script: &do_nothing_before
73     - *git_clean_stale_submodules
74     # apply bot filter in before script
75     - *apply_bot_filter
76     - echo "Not setting up GitLab key, not fetching submodules"
77     - source tools/ci/configure_ci_environment.sh
78
79 .add_gitlab_key_before:
80   before_script: &add_gitlab_key_before
81     - *git_clean_stale_submodules
82     # apply bot filter in before script
83     - *apply_bot_filter
84     - echo "Not fetching submodules"
85     - source tools/ci/configure_ci_environment.sh
86     # add gitlab ssh key
87     - mkdir -p ~/.ssh
88     - chmod 700 ~/.ssh
89     - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
90     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
91     - chmod 600 ~/.ssh/id_rsa
92     - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
93
94 build_template_app:
95   stage: build
96   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
97   tags:
98     - build
99   variables:
100     BATCH_BUILD: "1"
101     IDF_CI_BUILD: "1"
102   script:
103     - git clone https://github.com/espressif/esp-idf-template.git
104     - cd esp-idf-template
105     # Try to use the same branch name for esp-idf-template that we're
106     # using on esp-idf. If it doesn't exist then just stick to the default
107     # branch
108     - python $CHECKOUT_REF_SCRIPT esp-idf-template
109     # Test debug build (default)
110     - make all V=1
111     # Now test release build
112     - make clean
113     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
114     - make all V=1
115     # Check if there are any stray printf/ets_printf references in WiFi libs
116     - cd ../components/esp32/lib
117     - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
118     - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
119
120
121 .build_template: &build_template
122   stage: build
123   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
124   tags:
125     - build
126   variables:
127     BATCH_BUILD: "1"
128     V: "0"
129
130 .build_ssc_template: &build_ssc_template
131   <<: *build_template
132   artifacts:
133     paths:
134       - SSC/ssc_bin
135     expire_in: 1 mos
136   variables:
137     SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF"
138   script:
139     - git clone $SSC_REPOSITORY
140     - cd SSC
141     - python $CHECKOUT_REF_SCRIPT SSC
142     - MAKEFLAGS= ./ci_build_ssc.sh "${CI_JOB_NAME}" "${IDF_PATH}/.gitlab-ci.yml"
143
144 # don't forget to add to dependency to test_template when adding new build_ssc jobs
145 build_ssc_00:
146   <<: *build_ssc_template
147
148 build_ssc_01:
149   <<: *build_ssc_template
150
151 build_ssc_02:
152   <<: *build_ssc_template
153
154 # If you want to add new build ssc jobs, please add it into dependencies of `assign_test` and `.test_template`
155
156 build_esp_idf_tests:
157   <<: *build_template
158   artifacts:
159     paths:
160       - tools/unit-test-app/output
161       - components/idf_test/unit_test/TestCaseAll.yml
162       - components/idf_test/unit_test/CIConfigs/*.yml
163     expire_in: 1 mos
164   script:
165     - cd tools/unit-test-app
166     - MAKEFLAGS= make help # make sure kconfig tools are built in single process
167     - make ut-clean-all-configs
168     - export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
169     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
170     - make ut-build-all-configs
171     - python tools/UnitTestParser.py
172
173 .build_examples_template: &build_examples_template
174   <<: *build_template
175   retry: 1
176   artifacts:
177     when: always
178     paths:
179       - build_examples/*/*/*/build/*.bin
180       - build_examples/*/*/*/build/*.elf
181       - build_examples/*/*/*/build/*.map
182       - build_examples/*/*/*/build/download.config
183       - build_examples/*/*/*/build/bootloader/*.bin
184       - $LOG_PATH
185     expire_in: 1 week
186   variables:
187     IDF_CI_BUILD: "1"
188     LOG_PATH: "$CI_PROJECT_DIR/log_examples"
189   script:
190     # it's not possible to build 100% out-of-tree and have the "artifacts"
191     # mechanism work, but this is the next best thing
192     - rm -rf build_examples
193     - mkdir build_examples
194     - cd build_examples
195     # build some of examples
196     - mkdir -p ${LOG_PATH}
197     - ${IDF_PATH}/tools/ci/build_examples.sh "${CI_JOB_NAME}"
198
199 build_examples_00:
200   <<: *build_examples_template
201
202 build_examples_01:
203   <<: *build_examples_template
204
205 build_examples_02:
206   <<: *build_examples_template
207
208 build_examples_03:
209   <<: *build_examples_template
210
211 build_examples_04:
212   <<: *build_examples_template
213
214 build_examples_05:
215   <<: *build_examples_template
216
217 build_examples_06:
218   <<: *build_examples_template
219
220 build_examples_07:
221   <<: *build_examples_template
222
223 # If you want to add new build example jobs, please add it into dependencies of `.example_test_template`
224
225 build_docs:
226   stage: build
227   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
228   tags:
229     - build_docs
230   artifacts:
231     when: always
232     paths:
233       # English version of documentation
234       - docs/en/doxygen-warning-log.txt
235       - docs/en/sphinx-warning-log.txt
236       - docs/en/sphinx-warning-log-sanitized.txt
237       - docs/en/_build/html
238       # Chinese version of documentation
239       - docs/zh_CN/doxygen-warning-log.txt
240       - docs/zh_CN/sphinx-warning-log.txt
241       - docs/zh_CN/sphinx-warning-log-sanitized.txt
242       - docs/zh_CN/_build/html
243     expire_in: 1 mos
244   script:
245     - cd docs
246     - ./check_lang_folder_sync.sh
247     - cd en
248     - make gh-linkcheck
249     - make html
250     - ../check_doc_warnings.sh
251     - cd ../zh_CN
252     - make gh-linkcheck
253     - make html
254     - ../check_doc_warnings.sh
255
256 .host_test_template: &host_test_template
257   stage: host_test
258   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
259   tags:
260     - host_test
261   dependencies: []
262     
263 test_nvs_on_host:
264   <<: *host_test_template
265   script:
266     - cd components/nvs_flash/test_nvs_host
267     - make test
268
269 test_nvs_coverage:
270   <<: *host_test_template
271   artifacts:
272     paths:
273       - components/nvs_flash/test_nvs_host/coverage_report
274   only:
275     - triggers
276   # This job takes a few hours to finish, so only run it on demand
277   variables:
278     BOT_NEEDS_TRIGGER_BY_NAME: 1
279   script:
280     - cd components/nvs_flash/test_nvs_host
281     - make coverage_report
282
283 test_partition_table_on_host:
284   <<: *host_test_template
285   tags:
286     - build
287   script:
288     - cd components/partition_table/test_gen_esp32part_host
289     - ./gen_esp32part_tests.py
290
291 test_wl_on_host:
292   <<: *host_test_template
293   artifacts:
294     paths:
295       - components/wear_levelling/test_wl_host/coverage_report.zip
296   script:
297     - cd components/wear_levelling/test_wl_host
298     - make test
299
300 test_fatfs_on_host:
301   <<: *host_test_template
302   script:
303     - cd components/fatfs/test_fatfs_host/
304     - make test
305
306 test_mdns_fuzzer_on_host:
307   stage: host_test
308   image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
309   tags:
310     - host_test
311   dependencies: []
312   artifacts:
313     when: always
314     paths:
315       - components/mdns/test_afl_fuzz_host/out/crashes
316     expire_in: 1 mos
317   only:
318     # can only be triggered
319     - triggers
320   variables:
321     BOT_NEEDS_TRIGGER_BY_NAME: 1
322   script:
323     - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
324     - cd components/mdns/test_afl_fuzz_host/
325     # run AFL fuzzer for one hour
326     - ( make fuzz || pkill sleep ) &
327     - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
328     # check no crashes found
329     - "[ -z `ls out/crashes/` ] || exit 1"
330
331 test_spiffs_on_host:
332   <<: *host_test_template
333   script:
334     - cd components/spiffs/test_spiffs_host/
335     - make test
336
337 test_multi_heap_on_host:
338   <<: *host_test_template
339   script:
340     - cd components/heap/test_multi_heap_host
341     - ./test_all_configs.sh
342
343 test_build_system:
344   <<: *host_test_template
345   script:
346     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
347     - rm -rf test_build_system
348     - mkdir test_build_system
349     - cd test_build_system
350     - ${IDF_PATH}/tools/ci/test_build_system.sh
351
352 test_idf_monitor:
353   <<: *host_test_template
354   artifacts:
355     when: on_failure
356     paths:
357       - tools/test_idf_monitor/outputs/*
358     expire_in: 1 week
359   script:
360     - cd ${IDF_PATH}/tools/test_idf_monitor
361     - ./run_test_idf_monitor.py
362
363 test_esp_err_to_name_on_host:
364   <<: *host_test_template
365   artifacts:
366     when: on_failure
367     paths:
368       - components/esp32/esp_err_to_name.c
369     expire_in: 1 week
370   script:
371     - cd tools/
372     - source /opt/pyenv/activate
373     - pyenv global 2.7.15
374     - ./gen_esp_err_to_name.py
375     - 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)
376     - pyenv global 3.4.8
377     - ./gen_esp_err_to_name.py
378     - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || (echo 'Differences found between running under Python 2 and 3.'; exit 1)
379     - pyenv global system
380
381 push_to_github:
382   stage: deploy
383   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
384   tags:
385     - deploy
386   only:
387     - master
388     - /^release\/v/
389     - /^v\d+\.\d+(\.\d+)?($|-)/
390   when: on_success
391   dependencies: []
392   before_script: *do_nothing_before
393   script:
394     - mkdir -p ~/.ssh
395     - chmod 700 ~/.ssh
396     - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
397     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
398     - chmod 600 ~/.ssh/id_rsa
399     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
400     - git remote remove github &>/dev/null || true
401     - git remote add github git@github.com:espressif/esp-idf.git
402     # Need separate push commands for tag builds and for branch builds
403     - "[ -n \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_TAG}"
404     - "[ -z \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
405
406 deploy_docs:
407   stage: host_test
408   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
409   tags:
410     - deploy
411   only:
412    - master
413    - /^release\/v/
414    - /^v\d+\.\d+(\.\d+)?($|-)/
415    - triggers
416   dependencies:
417     - build_docs
418   before_script: *do_nothing_before
419   script:
420     - mkdir -p ~/.ssh
421     - chmod 700 ~/.ssh
422     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
423     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
424     - chmod 600 ~/.ssh/id_rsa
425     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
426     - export GIT_VER=$(git describe --always)
427     - cd docs/en/_build/
428     - mv html $GIT_VER
429     - tar czvf $GIT_VER.tar.gz $GIT_VER
430     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
431     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
432     - cd ../../zh_CN/_build/
433     - mv html $GIT_VER
434     - tar czvf $GIT_VER.tar.gz $GIT_VER
435     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
436     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
437     # add link to preview doc
438     - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
439     - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
440
441 check_doc_links:
442   stage: host_test
443   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
444   tags:
445     - check_doc_links
446   only:
447     # can only be triggered
448     - triggers
449   artifacts:
450     paths:
451       - docs/_build/linkcheck
452     expire_in: 1 mos
453   script:
454     # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
455     - test "$CHECK_LINKS" = "Yes" || exit 0
456     # can only run on master branch (otherwise the commit is not on Github yet)
457     - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
458     - cd docs
459     - make linkcheck
460
461 check_line_endings:
462   stage: deploy
463   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
464   tags:
465     - build
466   except:
467     - master
468     - /^release\/v/
469     - /^v\d+\.\d+(\.\d+)?($|-)/
470   dependencies: []
471   before_script: *do_nothing_before
472   script:
473     - tools/ci/check-line-endings.sh ${IDF_PATH}
474
475 check_commit_msg:
476   stage: deploy
477   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
478   tags:
479     - build
480   except:
481     - master
482     - /^release\/v/
483     - /^v\d+\.\d+(\.\d+)?($|-)/
484   dependencies: []
485   before_script: *do_nothing_before
486   script:
487     - git status
488     - git log -n10 --oneline
489     # commit start with "WIP: " need to be squashed before merge
490     - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
491
492 check_permissions:
493   stage: deploy
494   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
495   tags:
496     - build
497   except:
498     - master
499     - /^release\/v/
500     - /^v\d+\.\d+(\.\d+)?($|-)/
501   dependencies: []
502   before_script: *do_nothing_before
503   script:
504     - tools/ci/check-executable.sh
505
506 check_submodule_sync:
507   stage: deploy
508   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
509   tags:
510     - build
511   except:
512     - master
513     - /^release\/v/
514     - /^v\d+\.\d+(\.\d+)?($|-)/
515   dependencies: []
516   variables:
517     GIT_STRATEGY: clone
518   before_script: *do_nothing_before
519   script:
520     # check if all submodules are correctly synced to public repostory
521     - git submodule update --init --recursive
522
523 assign_test:
524   tags:
525     - assign_test
526   image: $CI_DOCKER_REGISTRY/ubuntu-test-env
527   stage: assign_test
528   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
529   # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
530   dependencies:
531     - build_ssc_00
532     - build_ssc_01
533     - build_ssc_02
534     - build_esp_idf_tests
535   variables:
536     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
537     EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
538   artifacts:
539     paths:
540       - components/idf_test/*/CIConfigs
541       - components/idf_test/*/TC.sqlite
542       - $EXAMPLE_CONFIG_OUTPUT_PATH
543     expire_in: 1 mos
544   before_script: *add_gitlab_key_before
545   script:
546     # assign example tests
547     - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
548     # assign unit test cases
549     - 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
550     # clone test script to assign tests
551     - git clone $TEST_SCRIPT_REPOSITORY
552     - cd auto_test_script
553     - python $CHECKOUT_REF_SCRIPT auto_test_script
554     # assgin integration test cases
555     - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
556
557 .example_test_template: &example_test_template
558   stage: integration_test
559   when: on_success
560   only:
561     - master
562     - /^release\/v/
563     - /^v\d+\.\d+(\.\d+)?($|-)/
564     - triggers
565     - schedules
566   dependencies:
567     - assign_test
568     - build_examples_00
569     - build_examples_01
570     - build_examples_02
571     - build_examples_03
572     - build_examples_04
573     - build_examples_05
574     - build_examples_06
575     - build_examples_07
576   artifacts:
577     when: always
578     paths:
579       - $LOG_PATH
580     expire_in: 1 mos
581   variables:
582     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
583     TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
584     CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
585     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
586     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
587   script:
588     # first test if config file exists, if not exist, exit 0
589     - test -e $CONFIG_FILE || exit 0
590     # clone test env configs
591     - git clone $TEST_ENV_CONFIG_REPOSITORY
592     - cd ci-test-runner-configs
593     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
594     - cd $TEST_FW_PATH
595     # run test
596     - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
597
598 .unit_test_template: &unit_test_template
599   <<: *example_test_template
600   stage: unit_test
601   dependencies:
602     - assign_test
603     - build_esp_idf_tests
604   variables:
605     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
606     TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
607     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
608     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
609     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
610
611 .test_template: &test_template
612   stage: integration_test
613   when: on_success
614   only:
615     - master
616     - /^release\/v/
617     - /^v\d+\.\d+(\.\d+)?($|-)/
618     - triggers
619     - schedules
620   dependencies:
621     - assign_test
622     - build_ssc_00
623     - build_ssc_01
624     - build_ssc_02
625   artifacts:
626     when: always
627     paths:
628       - $LOG_PATH
629     expire_in: 1 mos
630   variables:
631     LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
632     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
633     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
634     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
635     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
636   before_script: *add_gitlab_key_before
637   script:
638     # first test if config file exists, if not exist, exit 0
639     - test -e $CONFIG_FILE || exit 0
640     # clone local test env configs
641     - git clone $TEST_ENV_CONFIG_REPOSITORY
642     - cd ci-test-runner-configs
643     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
644     # clone test bench
645     - git clone $TEST_SCRIPT_REPOSITORY
646     - cd auto_test_script
647     - python $CHECKOUT_REF_SCRIPT auto_test_script
648     # run test
649     - 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
650
651 nvs_compatible_test:
652   <<: *test_template
653   artifacts:
654     when: always
655     paths:
656       - $LOG_PATH
657       - nvs_wifi.bin
658     expire_in: 1 mos
659   tags:
660     - ESP32_IDF
661     - NVS_Compatible
662   script:
663     # clone local test env configs
664     - git clone $TEST_ENV_CONFIG_REPOSITORY
665     - cd ci-test-runner-configs
666     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
667     # clone test bench
668     - git clone $TEST_SCRIPT_REPOSITORY
669     - cd auto_test_script
670     - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
671     # prepare nvs bins
672     - ./Tools/prepare_nvs_bin.sh
673     # run test
674     - 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
675
676 example_test_001_01:
677   <<: *example_test_template
678   tags:
679     - ESP32
680     - Example_WIFI
681
682 example_test_002_01:
683   <<: *example_test_template
684   tags:
685     - ESP32
686     - Example_ShieldBox
687
688 example_test_003_01:
689   <<: *example_test_template
690   tags:
691     - ESP32
692     - Example_SDIO
693
694 example_test_004_01:
695   <<: *example_test_template
696   tags:
697     - ESP32
698     - Example_CAN
699
700 UT_001_01:
701   <<: *unit_test_template
702   tags:
703     - ESP32_IDF
704     - UT_T1_1
705
706 UT_001_02:
707   <<: *unit_test_template
708   tags:
709     - ESP32_IDF
710     - UT_T1_1
711
712 UT_001_03:
713   <<: *unit_test_template
714   tags:
715     - ESP32_IDF
716     - UT_T1_1
717
718 UT_001_04:
719   <<: *unit_test_template
720   tags:
721     - ESP32_IDF
722     - UT_T1_1
723
724 UT_001_05:
725   <<: *unit_test_template
726   tags:
727     - ESP32_IDF
728     - UT_T1_1
729
730 UT_001_06:
731   <<: *unit_test_template
732   tags:
733     - ESP32_IDF
734     - UT_T1_1
735
736 UT_001_07:
737   <<: *unit_test_template
738   tags:
739     - ESP32_IDF
740     - UT_T1_1
741
742 UT_001_08:
743   <<: *unit_test_template
744   tags:
745     - ESP32_IDF
746     - UT_T1_1
747
748 UT_001_09:
749   <<: *unit_test_template
750   tags:
751     - ESP32_IDF
752     - UT_T1_1
753
754 UT_001_10:
755   <<: *unit_test_template
756   tags:
757     - ESP32_IDF
758     - UT_T1_1
759
760 UT_001_11:
761   <<: *unit_test_template
762   tags:
763     - ESP32_IDF
764     - UT_T1_1
765
766 UT_001_12:
767   <<: *unit_test_template
768   tags:
769     - ESP32_IDF
770     - UT_T1_1
771
772 UT_001_13:
773   <<: *unit_test_template
774   tags:
775     - ESP32_IDF
776     - UT_T1_1
777
778 UT_001_14:
779   <<: *unit_test_template
780   tags:
781     - ESP32_IDF
782     - UT_T1_1
783
784 UT_001_15:
785   <<: *unit_test_template
786   tags:
787     - ESP32_IDF
788     - UT_T1_1
789
790 UT_001_16:
791   <<: *unit_test_template
792   tags:
793     - ESP32_IDF
794     - UT_T1_1
795
796 UT_001_17:
797   <<: *unit_test_template
798   tags:
799     - ESP32_IDF
800     - UT_T1_1
801
802 UT_001_18:
803   <<: *unit_test_template
804   tags:
805     - ESP32_IDF
806     - UT_T1_1
807
808 UT_001_19:
809   <<: *unit_test_template
810   tags:
811     - ESP32_IDF
812     - UT_T1_1
813
814 UT_001_20:
815   <<: *unit_test_template
816   tags:
817     - ESP32_IDF
818     - UT_T1_1
819
820 UT_001_21:
821   <<: *unit_test_template
822   tags:
823     - ESP32_IDF
824     - UT_T1_1
825
826 UT_001_22:
827   <<: *unit_test_template
828   tags:
829     - ESP32_IDF
830     - UT_T1_1
831
832 UT_001_23:
833   <<: *unit_test_template
834   tags:
835     - ESP32_IDF
836     - UT_T1_1
837
838 UT_001_24:
839   <<: *unit_test_template
840   tags:
841     - ESP32_IDF
842     - UT_T1_1
843
844 UT_001_25:
845   <<: *unit_test_template
846   tags:
847     - ESP32_IDF
848     - UT_T1_1
849     
850 UT_001_26:
851   <<: *unit_test_template
852   tags:
853     - ESP32_IDF
854     - UT_T1_1
855
856 UT_001_27:
857   <<: *unit_test_template
858   tags:
859     - ESP32_IDF
860     - UT_T1_1
861
862 UT_001_28:
863   <<: *unit_test_template
864   tags:
865     - ESP32_IDF
866     - UT_T1_1
867
868 UT_001_29:
869   <<: *unit_test_template
870   tags:
871     - ESP32_IDF
872     - UT_T1_1
873
874 UT_001_30:
875   <<: *unit_test_template
876   tags:
877     - ESP32_IDF
878     - UT_T1_1
879
880 UT_001_31:
881   <<: *unit_test_template
882   tags:
883     - ESP32_IDF
884     - UT_T1_1
885     
886 UT_001_32:
887   <<: *unit_test_template
888   tags:
889     - ESP32_IDF
890     - UT_T1_1
891
892 UT_001_33:
893   <<: *unit_test_template
894   tags:
895     - ESP32_IDF
896     - UT_T1_1
897     
898 UT_001_34:
899   <<: *unit_test_template
900   tags:
901     - ESP32_IDF
902     - UT_T1_1
903
904 UT_001_35:
905   <<: *unit_test_template
906   tags:
907     - ESP32_IDF
908     - UT_T1_1
909
910 UT_001_36:
911   <<: *unit_test_template
912   tags:
913     - ESP32_IDF
914     - UT_T1_1
915
916 UT_002_01:
917   <<: *unit_test_template
918   tags:
919     - ESP32_IDF
920     - UT_T1_SDMODE
921
922 UT_002_02:
923   <<: *unit_test_template
924   tags:
925     - ESP32_IDF
926     - UT_T1_SDMODE
927
928 UT_002_03:
929   <<: *unit_test_template
930   tags:
931     - ESP32_IDF
932     - UT_T1_SDMODE
933
934 UT_003_01:
935   <<: *unit_test_template
936   tags:
937     - ESP32_IDF
938     - UT_T1_SPIMODE
939
940 UT_003_02:
941   <<: *unit_test_template
942   tags:
943     - ESP32_IDF
944     - UT_T1_SPIMODE
945
946 UT_003_03:
947   <<: *unit_test_template
948   tags:
949     - ESP32_IDF
950     - UT_T1_SPIMODE
951
952 UT_004_01:
953   <<: *unit_test_template
954   tags:
955     - ESP32_IDF
956     - UT_T1_1
957     - psram
958
959 UT_004_02:
960   <<: *unit_test_template
961   tags:
962     - ESP32_IDF
963     - UT_T1_1
964     - psram
965
966 UT_004_03:
967   <<: *unit_test_template
968   tags:
969     - ESP32_IDF
970     - UT_T1_1
971     - psram
972
973 UT_004_04:
974   <<: *unit_test_template
975   tags:
976     - ESP32_IDF
977     - UT_T1_1
978     - psram
979
980 UT_004_05:
981   <<: *unit_test_template
982   tags:
983     - ESP32_IDF
984     - UT_T1_1
985     - psram
986
987 UT_004_06:
988   <<: *unit_test_template
989   tags:
990     - ESP32_IDF
991     - UT_T1_1
992     - psram
993
994 UT_004_07:
995   <<: *unit_test_template
996   tags:
997     - ESP32_IDF
998     - UT_T1_1
999     - psram
1000
1001 UT_004_08:
1002   <<: *unit_test_template
1003   tags:
1004     - ESP32_IDF
1005     - UT_T1_1
1006     - psram
1007
1008 UT_004_09:
1009   <<: *unit_test_template
1010   tags:
1011     - ESP32_IDF
1012     - UT_T1_1
1013     - psram
1014
1015 UT_004_10:
1016   <<: *unit_test_template
1017   tags:
1018     - ESP32_IDF
1019     - UT_T1_1
1020     - psram
1021     
1022 UT_004_11:
1023   <<: *unit_test_template
1024   tags:
1025     - ESP32_IDF
1026     - UT_T1_1
1027     - psram
1028     
1029 UT_005_01:
1030   <<: *unit_test_template
1031   tags:
1032     - ESP32_IDF
1033     - UT_T1_SDMODE
1034     - psram
1035
1036 UT_005_02:
1037   <<: *unit_test_template
1038   tags:
1039     - ESP32_IDF
1040     - UT_T1_SPIMODE
1041     - psram
1042
1043 UT_006_01:
1044   <<: *unit_test_template
1045   tags:
1046     - ESP32_IDF
1047     - UT_T1_GPIO
1048
1049 UT_006_02:
1050   <<: *unit_test_template
1051   tags:
1052     - ESP32_IDF
1053     - UT_T1_GPIO
1054
1055 UT_006_03:
1056   <<: *unit_test_template
1057   tags:
1058     - ESP32_IDF
1059     - UT_T1_GPIO
1060
1061 UT_006_04:
1062   <<: *unit_test_template
1063   tags:
1064     - ESP32_IDF
1065     - UT_T1_GPIO
1066     - psram
1067
1068 UT_007_01:
1069   <<: *unit_test_template
1070   tags:
1071     - ESP32_IDF
1072     - UT_T1_PCNT
1073
1074 UT_007_02:
1075   <<: *unit_test_template
1076   tags:
1077     - ESP32_IDF
1078     - UT_T1_PCNT
1079
1080 UT_007_03:
1081   <<: *unit_test_template
1082   tags:
1083     - ESP32_IDF
1084     - UT_T1_PCNT
1085
1086 UT_007_04:
1087   <<: *unit_test_template
1088   tags:
1089     - ESP32_IDF
1090     - UT_T1_PCNT
1091     - psram
1092
1093 UT_008_01:
1094   <<: *unit_test_template
1095   tags:
1096     - ESP32_IDF
1097     - UT_T1_LEDC
1098
1099 UT_008_02:
1100   <<: *unit_test_template
1101   tags:
1102     - ESP32_IDF
1103     - UT_T1_LEDC
1104
1105 UT_008_03:
1106   <<: *unit_test_template
1107   tags:
1108     - ESP32_IDF
1109     - UT_T1_LEDC
1110
1111 UT_008_04:
1112   <<: *unit_test_template
1113   tags:
1114     - ESP32_IDF
1115     - UT_T1_LEDC
1116     - psram
1117
1118 UT_010_01:
1119   <<: *unit_test_template
1120   tags:
1121     - ESP32_IDF
1122     - UT_T1_RMT
1123
1124 UT_010_02:
1125   <<: *unit_test_template
1126   tags:
1127     - ESP32_IDF
1128     - UT_T1_RMT
1129
1130 UT_010_03:
1131   <<: *unit_test_template
1132   tags:
1133     - ESP32_IDF
1134     - UT_T1_RMT
1135
1136 UT_010_04:
1137   <<: *unit_test_template
1138   tags:
1139     - ESP32_IDF
1140     - UT_T1_RMT
1141     - psram
1142
1143 UT_601_01:
1144   <<: *unit_test_template
1145   tags:
1146     - ESP32_IDF
1147     - UT_T1_1
1148
1149 IT_001_01:
1150   <<: *test_template
1151   tags:
1152     - ESP32_IDF
1153     - SSC_T1_1
1154
1155 IT_001_02:
1156   <<: *test_template
1157   tags:
1158     - ESP32_IDF
1159     - SSC_T1_1
1160
1161 IT_001_03:
1162   <<: *test_template
1163   tags:
1164     - ESP32_IDF
1165     - SSC_T1_1
1166
1167 IT_001_04:
1168   <<: *test_template
1169   tags:
1170     - ESP32_IDF
1171     - SSC_T1_1
1172
1173 IT_001_05:
1174   <<: *test_template
1175   tags:
1176     - ESP32_IDF
1177     - SSC_T1_1
1178
1179 IT_001_06:
1180   <<: *test_template
1181   tags:
1182     - ESP32_IDF
1183     - SSC_T1_1
1184
1185 IT_001_07:
1186   <<: *test_template
1187   tags:
1188     - ESP32_IDF
1189     - SSC_T1_1
1190
1191 IT_001_08:
1192   <<: *test_template
1193   tags:
1194     - ESP32_IDF
1195     - SSC_T1_1
1196
1197 IT_001_09:
1198   <<: *test_template
1199   tags:
1200     - ESP32_IDF
1201     - SSC_T1_1
1202
1203 IT_002_01:
1204   <<: *test_template
1205   tags:
1206     - ESP32_IDF
1207     - SSC_T1_2
1208
1209 IT_003_01:
1210   <<: *test_template
1211   tags:
1212     - ESP32_IDF
1213     - SSC_T2_1
1214
1215 IT_003_02:
1216   <<: *test_template
1217   tags:
1218     - ESP32_IDF
1219     - SSC_T2_1
1220
1221 IT_003_03:
1222   <<: *test_template
1223   tags:
1224     - ESP32_IDF
1225     - SSC_T2_1
1226
1227 IT_003_04:
1228   <<: *test_template
1229   tags:
1230     - ESP32_IDF
1231     - SSC_T2_1
1232
1233 IT_003_05:
1234   <<: *test_template
1235   tags:
1236     - ESP32_IDF
1237     - SSC_T2_1
1238
1239 IT_003_06:
1240   <<: *test_template
1241   tags:
1242     - ESP32_IDF
1243     - SSC_T2_1
1244
1245 IT_003_07:
1246   <<: *test_template
1247   tags:
1248     - ESP32_IDF
1249     - SSC_T2_1
1250
1251 IT_003_08:
1252   <<: *test_template
1253   tags:
1254     - ESP32_IDF
1255     - SSC_T2_1
1256
1257 IT_003_09:
1258   <<: *test_template
1259   tags:
1260     - ESP32_IDF
1261     - SSC_T2_1
1262
1263 IT_003_10:
1264   <<: *test_template
1265   tags:
1266     - ESP32_IDF
1267     - SSC_T2_1
1268
1269 IT_003_11:
1270   <<: *test_template
1271   tags:
1272     - ESP32_IDF
1273     - SSC_T2_1
1274
1275 IT_003_12:
1276   <<: *test_template
1277   tags:
1278     - ESP32_IDF
1279     - SSC_T2_1
1280
1281 IT_003_13:
1282   <<: *test_template
1283   tags:
1284     - ESP32_IDF
1285     - SSC_T2_1
1286
1287 IT_003_14:
1288   <<: *test_template
1289   tags:
1290     - ESP32_IDF
1291     - SSC_T2_1
1292
1293 IT_004_01:
1294   <<: *test_template
1295   tags:
1296     - ESP32_IDF
1297     - SSC_T1_APC
1298
1299 IT_005_01:
1300   <<: *test_template
1301   tags:
1302     - ESP32_IDF
1303     - SSC_T1_WEP
1304
1305 IT_009_01:
1306   <<: *test_template
1307   tags:
1308     - ESP32_IDF
1309     - SSC_T1_3
1310
1311 IT_010_01:
1312   <<: *test_template
1313   tags:
1314     - ESP32_IDF
1315     - SSC_T5_1
1316
1317 IT_011_01:
1318   <<: *test_template
1319   tags:
1320     - ESP32_IDF
1321     - SSC_T50_1
1322
1323 IT_501_01:
1324   <<: *test_template
1325   tags:
1326     - ESP32_IDF
1327     - SSC_T1_1
1328     - stress_test
1329
1330 IT_501_02:
1331   <<: *test_template
1332   tags:
1333     - ESP32_IDF
1334     - SSC_T1_1
1335     - stress_test
1336
1337 IT_501_03:
1338   <<: *test_template
1339   tags:
1340     - ESP32_IDF
1341     - SSC_T1_1
1342     - stress_test
1343
1344 IT_502_01:
1345   <<: *test_template
1346   tags:
1347     - ESP32_IDF
1348     - SSC_T2_1
1349     - stress_test
1350
1351 IT_502_02:
1352   <<: *test_template
1353   tags:
1354     - ESP32_IDF
1355     - SSC_T2_1
1356     - stress_test
1357
1358 IT_503_01:
1359   <<: *test_template
1360   tags:
1361     - ESP32_IDF
1362     - SSC_T5_1
1363     - stress_test
1364
1365 IT_503_02:
1366   <<: *test_template
1367   tags:
1368     - ESP32_IDF
1369     - SSC_T5_1
1370     - stress_test
1371
1372 IT_503_03:
1373   <<: *test_template
1374   tags:
1375     - ESP32_IDF
1376     - SSC_T5_1
1377     - stress_test