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