]> granicus.if.org Git - esp-idf/blob - .gitlab-ci.yml
Merge branch 'bugfix/github_deploy_regression' into 'master'
[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$BOT_DOCKER_IMAGE_TAG
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   script:
366     - cd tools/
367     - ./gen_esp_err_to_name.py
368     - 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)
369
370 push_to_github:
371   stage: deploy
372   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
373   tags:
374     - deploy
375   only:
376     - master
377     - /^release\/v/
378     - /^v\d+\.\d+(\.\d+)?($|-)/
379   when: on_success
380   dependencies: []
381   before_script: *do_nothing_before
382   script:
383     - mkdir -p ~/.ssh
384     - chmod 700 ~/.ssh
385     - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
386     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
387     - chmod 600 ~/.ssh/id_rsa
388     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
389     - git remote remove github &>/dev/null || true
390     - git remote add github git@github.com:espressif/esp-idf.git
391     # Need separate push commands for tag builds and for branch builds
392     - "[ -n \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_TAG}"
393     - "[ -z \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
394
395 deploy_docs:
396   stage: host_test
397   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
398   tags:
399     - deploy
400   only:
401    - master
402    - /^release\/v/
403    - /^v\d+\.\d+(\.\d+)?($|-)/
404    - triggers
405   dependencies:
406     - build_docs
407   before_script: *do_nothing_before
408   script:
409     - mkdir -p ~/.ssh
410     - chmod 700 ~/.ssh
411     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
412     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
413     - chmod 600 ~/.ssh/id_rsa
414     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
415     - export GIT_VER=$(git describe --always)
416     - cd docs/en/_build/
417     - mv html $GIT_VER
418     - tar czvf $GIT_VER.tar.gz $GIT_VER
419     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
420     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
421     - cd ../../zh_CN/_build/
422     - mv html $GIT_VER
423     - tar czvf $GIT_VER.tar.gz $GIT_VER
424     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
425     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
426     # add link to preview doc
427     - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
428     - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
429
430 check_doc_links:
431   stage: host_test
432   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
433   tags:
434     - check_doc_links
435   only:
436     # can only be triggered
437     - triggers
438   artifacts:
439     paths:
440       - docs/_build/linkcheck
441     expire_in: 1 mos
442   script:
443     # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
444     - test "$CHECK_LINKS" = "Yes" || exit 0
445     # can only run on master branch (otherwise the commit is not on Github yet)
446     - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
447     - cd docs
448     - make linkcheck
449
450 check_line_endings:
451   stage: deploy
452   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
453   tags:
454     - build
455   except:
456     - master
457     - /^release\/v/
458     - /^v\d+\.\d+(\.\d+)?($|-)/
459   dependencies: []
460   before_script: *do_nothing_before
461   script:
462     - tools/ci/check-line-endings.sh ${IDF_PATH}
463
464 check_commit_msg:
465   stage: deploy
466   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
467   tags:
468     - build
469   except:
470     - master
471     - /^release\/v/
472     - /^v\d+\.\d+(\.\d+)?($|-)/
473   dependencies: []
474   before_script: *do_nothing_before
475   script:
476     - git status
477     - git log -n10 --oneline
478     # commit start with "WIP: " need to be squashed before merge
479     - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
480
481 check_permissions:
482   stage: deploy
483   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
484   tags:
485     - build
486   except:
487     - master
488     - /^release\/v/
489     - /^v\d+\.\d+(\.\d+)?($|-)/
490   dependencies: []
491   before_script: *do_nothing_before
492   script:
493     - tools/ci/check-executable.sh
494
495 check_submodule_sync:
496   stage: deploy
497   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
498   tags:
499     - build
500   except:
501     - master
502     - /^release\/v/
503     - /^v\d+\.\d+(\.\d+)?($|-)/
504   dependencies: []
505   variables:
506     GIT_STRATEGY: clone
507   before_script: *do_nothing_before
508   script:
509     # check if all submodules are correctly synced to public repostory
510     - git submodule update --init --recursive
511
512 assign_test:
513   tags:
514     - assign_test
515   image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
516   stage: assign_test
517   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
518   # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
519   dependencies:
520     - build_ssc_00
521     - build_ssc_01
522     - build_ssc_02
523     - build_esp_idf_tests
524   variables:
525     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
526     EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
527   artifacts:
528     paths:
529       - components/idf_test/*/CIConfigs
530       - components/idf_test/*/TC.sqlite
531       - $EXAMPLE_CONFIG_OUTPUT_PATH
532     expire_in: 1 mos
533   before_script: *add_gitlab_key_before
534   script:
535     # assign example tests
536     - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
537     # assign unit test cases
538     - 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
539     # clone test script to assign tests
540     - git clone $TEST_SCRIPT_REPOSITORY
541     - cd auto_test_script
542     - python $CHECKOUT_REF_SCRIPT auto_test_script
543     # assgin integration test cases
544     - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
545
546 .example_test_template: &example_test_template
547   stage: integration_test
548   when: on_success
549   only:
550     - master
551     - /^release\/v/
552     - /^v\d+\.\d+(\.\d+)?($|-)/
553     - triggers
554     - schedules
555   dependencies:
556     - assign_test
557     - build_examples_00
558     - build_examples_01
559     - build_examples_02
560     - build_examples_03
561     - build_examples_04
562     - build_examples_05
563     - build_examples_06
564     - build_examples_07
565   artifacts:
566     when: always
567     paths:
568       - $LOG_PATH
569     expire_in: 1 mos
570   variables:
571     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
572     TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
573     CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
574     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
575     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
576   script:
577     # first test if config file exists, if not exist, exit 0
578     - test -e $CONFIG_FILE || exit 0
579     # clone test env configs
580     - git clone $TEST_ENV_CONFIG_REPOSITORY
581     - cd ci-test-runner-configs
582     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
583     - cd $TEST_FW_PATH
584     # run test
585     - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
586
587 .unit_test_template: &unit_test_template
588   <<: *example_test_template
589   stage: unit_test
590   dependencies:
591     - assign_test
592     - build_esp_idf_tests
593   variables:
594     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
595     TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
596     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
597     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
598     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
599
600 .test_template: &test_template
601   stage: integration_test
602   when: on_success
603   only:
604     - master
605     - /^release\/v/
606     - /^v\d+\.\d+(\.\d+)?($|-)/
607     - triggers
608     - schedules
609   dependencies:
610     - assign_test
611     - build_ssc_00
612     - build_ssc_01
613     - build_ssc_02
614   artifacts:
615     when: always
616     paths:
617       - $LOG_PATH
618     expire_in: 1 mos
619   variables:
620     LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
621     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
622     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
623     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
624     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
625   before_script: *add_gitlab_key_before
626   script:
627     # first test if config file exists, if not exist, exit 0
628     - test -e $CONFIG_FILE || exit 0
629     # clone local test env configs
630     - git clone $TEST_ENV_CONFIG_REPOSITORY
631     - cd ci-test-runner-configs
632     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
633     # clone test bench
634     - git clone $TEST_SCRIPT_REPOSITORY
635     - cd auto_test_script
636     - python $CHECKOUT_REF_SCRIPT auto_test_script
637     # run test
638     - 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
639
640 nvs_compatible_test:
641   <<: *test_template
642   artifacts:
643     when: always
644     paths:
645       - $LOG_PATH
646       - nvs_wifi.bin
647     expire_in: 1 mos
648   tags:
649     - ESP32_IDF
650     - NVS_Compatible
651   script:
652     # clone local test env configs
653     - git clone $TEST_ENV_CONFIG_REPOSITORY
654     - cd ci-test-runner-configs
655     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
656     # clone test bench
657     - git clone $TEST_SCRIPT_REPOSITORY
658     - cd auto_test_script
659     - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
660     # prepare nvs bins
661     - ./Tools/prepare_nvs_bin.sh
662     # run test
663     - 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
664
665 example_test_001_01:
666   <<: *example_test_template
667   tags:
668     - ESP32
669     - Example_WIFI
670
671 example_test_002_01:
672   <<: *example_test_template
673   tags:
674     - ESP32
675     - Example_ShieldBox
676
677 example_test_003_01:
678   <<: *example_test_template
679   tags:
680     - ESP32
681     - Example_SDIO
682
683 example_test_004_01:
684   <<: *example_test_template
685   tags:
686     - ESP32
687     - Example_CAN
688
689 UT_001_01:
690   <<: *unit_test_template
691   tags:
692     - ESP32_IDF
693     - UT_T1_1
694
695 UT_001_02:
696   <<: *unit_test_template
697   tags:
698     - ESP32_IDF
699     - UT_T1_1
700
701 UT_001_03:
702   <<: *unit_test_template
703   tags:
704     - ESP32_IDF
705     - UT_T1_1
706
707 UT_001_04:
708   <<: *unit_test_template
709   tags:
710     - ESP32_IDF
711     - UT_T1_1
712
713 UT_001_05:
714   <<: *unit_test_template
715   tags:
716     - ESP32_IDF
717     - UT_T1_1
718
719 UT_001_06:
720   <<: *unit_test_template
721   tags:
722     - ESP32_IDF
723     - UT_T1_1
724
725 UT_001_07:
726   <<: *unit_test_template
727   tags:
728     - ESP32_IDF
729     - UT_T1_1
730
731 UT_001_08:
732   <<: *unit_test_template
733   tags:
734     - ESP32_IDF
735     - UT_T1_1
736
737 UT_001_09:
738   <<: *unit_test_template
739   tags:
740     - ESP32_IDF
741     - UT_T1_1
742
743 UT_001_10:
744   <<: *unit_test_template
745   tags:
746     - ESP32_IDF
747     - UT_T1_1
748
749 UT_001_11:
750   <<: *unit_test_template
751   tags:
752     - ESP32_IDF
753     - UT_T1_1
754
755 UT_001_12:
756   <<: *unit_test_template
757   tags:
758     - ESP32_IDF
759     - UT_T1_1
760
761 UT_001_13:
762   <<: *unit_test_template
763   tags:
764     - ESP32_IDF
765     - UT_T1_1
766
767 UT_001_14:
768   <<: *unit_test_template
769   tags:
770     - ESP32_IDF
771     - UT_T1_1
772
773 UT_001_15:
774   <<: *unit_test_template
775   tags:
776     - ESP32_IDF
777     - UT_T1_1
778
779 UT_001_16:
780   <<: *unit_test_template
781   tags:
782     - ESP32_IDF
783     - UT_T1_1
784
785 UT_001_17:
786   <<: *unit_test_template
787   tags:
788     - ESP32_IDF
789     - UT_T1_1
790
791 UT_001_18:
792   <<: *unit_test_template
793   tags:
794     - ESP32_IDF
795     - UT_T1_1
796
797 UT_001_19:
798   <<: *unit_test_template
799   tags:
800     - ESP32_IDF
801     - UT_T1_1
802
803 UT_001_20:
804   <<: *unit_test_template
805   tags:
806     - ESP32_IDF
807     - UT_T1_1
808
809 UT_001_21:
810   <<: *unit_test_template
811   tags:
812     - ESP32_IDF
813     - UT_T1_1
814
815 UT_001_22:
816   <<: *unit_test_template
817   tags:
818     - ESP32_IDF
819     - UT_T1_1
820
821 UT_001_23:
822   <<: *unit_test_template
823   tags:
824     - ESP32_IDF
825     - UT_T1_1
826
827 UT_001_24:
828   <<: *unit_test_template
829   tags:
830     - ESP32_IDF
831     - UT_T1_1
832
833 UT_001_25:
834   <<: *unit_test_template
835   tags:
836     - ESP32_IDF
837     - UT_T1_1
838     
839 UT_001_26:
840   <<: *unit_test_template
841   tags:
842     - ESP32_IDF
843     - UT_T1_1
844
845 UT_001_27:
846   <<: *unit_test_template
847   tags:
848     - ESP32_IDF
849     - UT_T1_1
850
851 UT_001_28:
852   <<: *unit_test_template
853   tags:
854     - ESP32_IDF
855     - UT_T1_1
856
857 UT_001_29:
858   <<: *unit_test_template
859   tags:
860     - ESP32_IDF
861     - UT_T1_1
862
863 UT_001_30:
864   <<: *unit_test_template
865   tags:
866     - ESP32_IDF
867     - UT_T1_1
868
869 UT_001_31:
870   <<: *unit_test_template
871   tags:
872     - ESP32_IDF
873     - UT_T1_1
874     
875 UT_001_32:
876   <<: *unit_test_template
877   tags:
878     - ESP32_IDF
879     - UT_T1_1
880
881 UT_001_33:
882   <<: *unit_test_template
883   tags:
884     - ESP32_IDF
885     - UT_T1_1
886     
887 UT_001_34:
888   <<: *unit_test_template
889   tags:
890     - ESP32_IDF
891     - UT_T1_1
892
893 UT_002_01:
894   <<: *unit_test_template
895   tags:
896     - ESP32_IDF
897     - UT_T1_SDMODE
898
899 UT_002_02:
900   <<: *unit_test_template
901   tags:
902     - ESP32_IDF
903     - UT_T1_SDMODE
904
905 UT_002_03:
906   <<: *unit_test_template
907   tags:
908     - ESP32_IDF
909     - UT_T1_SDMODE
910
911 UT_003_01:
912   <<: *unit_test_template
913   tags:
914     - ESP32_IDF
915     - UT_T1_SPIMODE
916
917 UT_003_02:
918   <<: *unit_test_template
919   tags:
920     - ESP32_IDF
921     - UT_T1_SPIMODE
922
923 UT_003_03:
924   <<: *unit_test_template
925   tags:
926     - ESP32_IDF
927     - UT_T1_SPIMODE
928
929 UT_004_01:
930   <<: *unit_test_template
931   tags:
932     - ESP32_IDF
933     - UT_T1_1
934     - psram
935
936 UT_004_02:
937   <<: *unit_test_template
938   tags:
939     - ESP32_IDF
940     - UT_T1_1
941     - psram
942
943 UT_004_03:
944   <<: *unit_test_template
945   tags:
946     - ESP32_IDF
947     - UT_T1_1
948     - psram
949
950 UT_004_04:
951   <<: *unit_test_template
952   tags:
953     - ESP32_IDF
954     - UT_T1_1
955     - psram
956
957 UT_004_05:
958   <<: *unit_test_template
959   tags:
960     - ESP32_IDF
961     - UT_T1_1
962     - psram
963
964 UT_004_06:
965   <<: *unit_test_template
966   tags:
967     - ESP32_IDF
968     - UT_T1_1
969     - psram
970
971 UT_004_07:
972   <<: *unit_test_template
973   tags:
974     - ESP32_IDF
975     - UT_T1_1
976     - psram
977
978 UT_004_08:
979   <<: *unit_test_template
980   tags:
981     - ESP32_IDF
982     - UT_T1_1
983     - psram
984
985 UT_004_09:
986   <<: *unit_test_template
987   tags:
988     - ESP32_IDF
989     - UT_T1_1
990     - psram
991
992 UT_004_10:
993   <<: *unit_test_template
994   tags:
995     - ESP32_IDF
996     - UT_T1_1
997     - psram
998     
999 UT_004_11:
1000   <<: *unit_test_template
1001   tags:
1002     - ESP32_IDF
1003     - UT_T1_1
1004     - psram
1005     
1006 UT_005_01:
1007   <<: *unit_test_template
1008   tags:
1009     - ESP32_IDF
1010     - UT_T1_SDMODE
1011     - psram
1012
1013 UT_005_02:
1014   <<: *unit_test_template
1015   tags:
1016     - ESP32_IDF
1017     - UT_T1_SPIMODE
1018     - psram
1019
1020 UT_006_01:
1021   <<: *unit_test_template
1022   tags:
1023     - ESP32_IDF
1024     - UT_T1_GPIO
1025
1026 UT_006_02:
1027   <<: *unit_test_template
1028   tags:
1029     - ESP32_IDF
1030     - UT_T1_GPIO
1031
1032 UT_006_03:
1033   <<: *unit_test_template
1034   tags:
1035     - ESP32_IDF
1036     - UT_T1_GPIO
1037
1038 UT_006_04:
1039   <<: *unit_test_template
1040   tags:
1041     - ESP32_IDF
1042     - UT_T1_GPIO
1043     - psram
1044
1045 UT_007_01:
1046   <<: *unit_test_template
1047   tags:
1048     - ESP32_IDF
1049     - UT_T1_PCNT
1050
1051 UT_007_02:
1052   <<: *unit_test_template
1053   tags:
1054     - ESP32_IDF
1055     - UT_T1_PCNT
1056
1057 UT_007_03:
1058   <<: *unit_test_template
1059   tags:
1060     - ESP32_IDF
1061     - UT_T1_PCNT
1062
1063 UT_007_04:
1064   <<: *unit_test_template
1065   tags:
1066     - ESP32_IDF
1067     - UT_T1_PCNT
1068     - psram
1069
1070 UT_008_01:
1071   <<: *unit_test_template
1072   tags:
1073     - ESP32_IDF
1074     - UT_T1_LEDC
1075
1076 UT_008_02:
1077   <<: *unit_test_template
1078   tags:
1079     - ESP32_IDF
1080     - UT_T1_LEDC
1081
1082 UT_008_03:
1083   <<: *unit_test_template
1084   tags:
1085     - ESP32_IDF
1086     - UT_T1_LEDC
1087
1088 UT_008_04:
1089   <<: *unit_test_template
1090   tags:
1091     - ESP32_IDF
1092     - UT_T1_LEDC
1093     - psram
1094
1095 UT_010_01:
1096   <<: *unit_test_template
1097   tags:
1098     - ESP32_IDF
1099     - UT_T1_RMT
1100
1101 UT_010_02:
1102   <<: *unit_test_template
1103   tags:
1104     - ESP32_IDF
1105     - UT_T1_RMT
1106
1107 UT_010_03:
1108   <<: *unit_test_template
1109   tags:
1110     - ESP32_IDF
1111     - UT_T1_RMT
1112
1113 UT_010_04:
1114   <<: *unit_test_template
1115   tags:
1116     - ESP32_IDF
1117     - UT_T1_RMT
1118     - psram
1119
1120 IT_001_01:
1121   <<: *test_template
1122   tags:
1123     - ESP32_IDF
1124     - SSC_T1_1
1125
1126 IT_001_02:
1127   <<: *test_template
1128   tags:
1129     - ESP32_IDF
1130     - SSC_T1_1
1131
1132 IT_001_03:
1133   <<: *test_template
1134   tags:
1135     - ESP32_IDF
1136     - SSC_T1_1
1137
1138 IT_001_04:
1139   <<: *test_template
1140   tags:
1141     - ESP32_IDF
1142     - SSC_T1_1
1143
1144 IT_001_05:
1145   <<: *test_template
1146   tags:
1147     - ESP32_IDF
1148     - SSC_T1_1
1149
1150 IT_001_06:
1151   <<: *test_template
1152   tags:
1153     - ESP32_IDF
1154     - SSC_T1_1
1155
1156 IT_001_07:
1157   <<: *test_template
1158   tags:
1159     - ESP32_IDF
1160     - SSC_T1_1
1161
1162 IT_001_08:
1163   <<: *test_template
1164   tags:
1165     - ESP32_IDF
1166     - SSC_T1_1
1167
1168 IT_001_09:
1169   <<: *test_template
1170   tags:
1171     - ESP32_IDF
1172     - SSC_T1_1
1173
1174 IT_002_01:
1175   <<: *test_template
1176   tags:
1177     - ESP32_IDF
1178     - SSC_T1_2
1179
1180 IT_003_01:
1181   <<: *test_template
1182   tags:
1183     - ESP32_IDF
1184     - SSC_T2_1
1185
1186 IT_003_02:
1187   <<: *test_template
1188   tags:
1189     - ESP32_IDF
1190     - SSC_T2_1
1191
1192 IT_003_03:
1193   <<: *test_template
1194   tags:
1195     - ESP32_IDF
1196     - SSC_T2_1
1197
1198 IT_003_04:
1199   <<: *test_template
1200   tags:
1201     - ESP32_IDF
1202     - SSC_T2_1
1203
1204 IT_003_05:
1205   <<: *test_template
1206   tags:
1207     - ESP32_IDF
1208     - SSC_T2_1
1209
1210 IT_003_06:
1211   <<: *test_template
1212   tags:
1213     - ESP32_IDF
1214     - SSC_T2_1
1215
1216 IT_003_07:
1217   <<: *test_template
1218   tags:
1219     - ESP32_IDF
1220     - SSC_T2_1
1221
1222 IT_003_08:
1223   <<: *test_template
1224   tags:
1225     - ESP32_IDF
1226     - SSC_T2_1
1227
1228 IT_003_09:
1229   <<: *test_template
1230   tags:
1231     - ESP32_IDF
1232     - SSC_T2_1
1233
1234 IT_003_10:
1235   <<: *test_template
1236   tags:
1237     - ESP32_IDF
1238     - SSC_T2_1
1239
1240 IT_003_11:
1241   <<: *test_template
1242   tags:
1243     - ESP32_IDF
1244     - SSC_T2_1
1245
1246 IT_003_12:
1247   <<: *test_template
1248   tags:
1249     - ESP32_IDF
1250     - SSC_T2_1
1251
1252 IT_003_13:
1253   <<: *test_template
1254   tags:
1255     - ESP32_IDF
1256     - SSC_T2_1
1257
1258 IT_003_14:
1259   <<: *test_template
1260   tags:
1261     - ESP32_IDF
1262     - SSC_T2_1
1263
1264 IT_004_01:
1265   <<: *test_template
1266   tags:
1267     - ESP32_IDF
1268     - SSC_T1_APC
1269
1270 IT_005_01:
1271   <<: *test_template
1272   tags:
1273     - ESP32_IDF
1274     - SSC_T1_WEP
1275
1276 IT_009_01:
1277   <<: *test_template
1278   tags:
1279     - ESP32_IDF
1280     - SSC_T1_3
1281
1282 IT_010_01:
1283   <<: *test_template
1284   tags:
1285     - ESP32_IDF
1286     - SSC_T5_1
1287
1288 IT_011_01:
1289   <<: *test_template
1290   tags:
1291     - ESP32_IDF
1292     - SSC_T50_1
1293
1294 IT_501_01:
1295   <<: *test_template
1296   tags:
1297     - ESP32_IDF
1298     - SSC_T1_1
1299     - stress_test
1300
1301 IT_501_02:
1302   <<: *test_template
1303   tags:
1304     - ESP32_IDF
1305     - SSC_T1_1
1306     - stress_test
1307
1308 IT_501_03:
1309   <<: *test_template
1310   tags:
1311     - ESP32_IDF
1312     - SSC_T1_1
1313     - stress_test
1314
1315 IT_502_01:
1316   <<: *test_template
1317   tags:
1318     - ESP32_IDF
1319     - SSC_T2_1
1320     - stress_test
1321
1322 IT_502_02:
1323   <<: *test_template
1324   tags:
1325     - ESP32_IDF
1326     - SSC_T2_1
1327     - stress_test
1328
1329 IT_503_01:
1330   <<: *test_template
1331   tags:
1332     - ESP32_IDF
1333     - SSC_T5_1
1334     - stress_test
1335
1336 IT_503_02:
1337   <<: *test_template
1338   tags:
1339     - ESP32_IDF
1340     - SSC_T5_1
1341     - stress_test
1342
1343 IT_503_03:
1344   <<: *test_template
1345   tags:
1346     - ESP32_IDF
1347     - SSC_T5_1
1348     - stress_test