]> granicus.if.org Git - esp-idf/blob - .gitlab-ci.yml
Merge branch 'master' into feature/cmake
[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     # and again, with cmake!
199     - rm -rf ../build_examples_cmake
200     - mkdir ../build_examples_cmake
201     - cd ../build_examples_cmake
202     - mkdir -p ${LOG_PATH}_cmake
203     - LOG_PATH=${LOG_PATH}_cmake ${IDF_PATH}/tools/ci/build_examples_cmake.sh "${CI_JOB_NAME}"
204
205 build_examples_00:
206   <<: *build_examples_template
207
208 build_examples_01:
209   <<: *build_examples_template
210
211 build_examples_02:
212   <<: *build_examples_template
213
214 build_examples_03:
215   <<: *build_examples_template
216
217 build_examples_04:
218   <<: *build_examples_template
219
220 build_examples_05:
221   <<: *build_examples_template
222
223 build_examples_06:
224   <<: *build_examples_template
225
226 build_examples_07:
227   <<: *build_examples_template
228
229 # If you want to add new build example jobs, please add it into dependencies of `.example_test_template`
230
231 build_docs:
232   stage: build
233   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
234   tags:
235     - build_docs
236   artifacts:
237     when: always
238     paths:
239       # English version of documentation
240       - docs/en/doxygen-warning-log.txt
241       - docs/en/sphinx-warning-log.txt
242       - docs/en/sphinx-warning-log-sanitized.txt
243       - docs/en/_build/html
244       # Chinese version of documentation
245       - docs/zh_CN/doxygen-warning-log.txt
246       - docs/zh_CN/sphinx-warning-log.txt
247       - docs/zh_CN/sphinx-warning-log-sanitized.txt
248       - docs/zh_CN/_build/html
249     expire_in: 1 mos
250   script:
251     - cd docs
252     - ./check_lang_folder_sync.sh
253     - cd en
254     - make gh-linkcheck
255     - make html
256     - ../check_doc_warnings.sh
257     - cd ../zh_CN
258     - make gh-linkcheck
259     - make html
260     - ../check_doc_warnings.sh
261
262 verify_cmake_style:
263   stage: build
264   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
265   script:
266     tools/cmake/run_cmake_lint.sh
267
268 .host_test_template: &host_test_template
269   stage: host_test
270   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
271   tags:
272     - host_test
273   dependencies: []
274     
275 test_nvs_on_host:
276   <<: *host_test_template
277   script:
278     - cd components/nvs_flash/test_nvs_host
279     - make test
280
281 test_nvs_coverage:
282   <<: *host_test_template
283   artifacts:
284     paths:
285       - components/nvs_flash/test_nvs_host/coverage_report
286   only:
287     - triggers
288   # This job takes a few hours to finish, so only run it on demand
289   variables:
290     BOT_NEEDS_TRIGGER_BY_NAME: 1
291   script:
292     - cd components/nvs_flash/test_nvs_host
293     - make coverage_report
294
295 test_partition_table_on_host:
296   <<: *host_test_template
297   tags:
298     - build
299   script:
300     - cd components/partition_table/test_gen_esp32part_host
301     - ./gen_esp32part_tests.py
302
303 test_wl_on_host:
304   <<: *host_test_template
305   artifacts:
306     paths:
307       - components/wear_levelling/test_wl_host/coverage_report.zip
308   script:
309     - cd components/wear_levelling/test_wl_host
310     - make test
311
312 test_fatfs_on_host:
313   <<: *host_test_template
314   script:
315     - cd components/fatfs/test_fatfs_host/
316     - make test
317
318 .host_fuzzer_test_template: &host_fuzzer_test_template
319   stage: host_test
320   image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
321   tags:
322     - host_test
323   dependencies: []
324   artifacts:
325     when: always
326     paths:
327       - ${FUZZER_TEST_DIR}/out/crashes
328       - ${FUZZER_TEST_DIR}/fuzz_output.log
329     expire_in: 1 mos
330   only:
331     # can only be triggered
332     - triggers
333   script:
334     - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
335     - cd ${FUZZER_TEST_DIR}
336     # run AFL fuzzer for one hour
337     - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
338     - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
339     # check no crashes found
340     - test -z "$(ls out/crashes/)" || exit 1
341
342 test_mdns_fuzzer_on_host:
343   <<: *host_fuzzer_test_template
344   variables:
345     BOT_NEEDS_TRIGGER_BY_NAME: 1
346     FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
347
348 test_lwip_dns_fuzzer_on_host:
349   <<: *host_fuzzer_test_template
350   variables:
351     BOT_NEEDS_TRIGGER_BY_NAME: 1
352     FUZZER_TEST_DIR: components/lwip/test_afl_host
353     FUZZER_PARAMS: MODE=dns
354
355 test_lwip_dhcp_fuzzer_on_host:
356   <<: *host_fuzzer_test_template
357   variables:
358     BOT_NEEDS_TRIGGER_BY_NAME: 1
359     FUZZER_TEST_DIR: components/lwip/test_afl_host
360     FUZZER_PARAMS: MODE=dhcp_client
361
362 test_lwip_dhcps_fuzzer_on_host:
363   <<: *host_fuzzer_test_template
364   variables:
365     BOT_NEEDS_TRIGGER_BY_NAME: 1
366     FUZZER_TEST_DIR: components/lwip/test_afl_host
367     FUZZER_PARAMS: MODE=dhcp_server
368
369 test_spiffs_on_host:
370   <<: *host_test_template
371   script:
372     - cd components/spiffs/test_spiffs_host/
373     - make test
374
375 test_multi_heap_on_host:
376   <<: *host_test_template
377   script:
378     - cd components/heap/test_multi_heap_host
379     - ./test_all_configs.sh
380
381 test_confserver:
382   <<: *host_test_template
383   script:
384     - cd tools/kconfig_new/test
385     - ./test_confserver.py
386
387 test_build_system:
388   <<: *host_test_template
389   script:
390     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
391     - rm -rf test_build_system
392     - mkdir test_build_system
393     - cd test_build_system
394     - ${IDF_PATH}/tools/ci/test_build_system.sh
395
396 test_build_system_cmake:
397   <<: *host_test_template
398   script:
399     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
400     - rm -rf test_build_system
401     - mkdir test_build_system
402     - cd test_build_system
403     - ${IDF_PATH}/tools/ci/test_build_system_cmake.sh
404
405 test_idf_monitor:
406   <<: *host_test_template
407   artifacts:
408     when: on_failure
409     paths:
410       - tools/test_idf_monitor/outputs/*
411     expire_in: 1 week
412   script:
413     - cd ${IDF_PATH}/tools/test_idf_monitor
414     - source /opt/pyenv/activate
415     - pyenv global 2.7.15
416     - ./run_test_idf_monitor.py
417     - pyenv global 3.4.8
418     - ./run_test_idf_monitor.py
419     - pyenv global system
420
421 test_esp_err_to_name_on_host:
422   <<: *host_test_template
423   artifacts:
424     when: on_failure
425     paths:
426       - components/esp32/esp_err_to_name.c
427     expire_in: 1 week
428   script:
429     - cd tools/
430     - source /opt/pyenv/activate
431     - pyenv global 2.7.15
432     - ./gen_esp_err_to_name.py
433     - 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)
434     - pyenv global 3.4.8
435     - ./gen_esp_err_to_name.py
436     - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || (echo 'Differences found between running under Python 2 and 3.'; exit 1)
437     - pyenv global system
438
439 push_to_github:
440   stage: deploy
441   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
442   tags:
443     - deploy
444   only:
445     - master
446     - /^release\/v/
447     - /^v\d+\.\d+(\.\d+)?($|-)/
448   when: on_success
449   dependencies: []
450   before_script: *do_nothing_before
451   script:
452     - mkdir -p ~/.ssh
453     - chmod 700 ~/.ssh
454     - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
455     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
456     - chmod 600 ~/.ssh/id_rsa
457     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
458     - git remote remove github &>/dev/null || true
459     - git remote add github git@github.com:espressif/esp-idf.git
460     # Need separate push commands for tag builds and for branch builds
461     - "[ -n \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_TAG}"
462     - "[ -z \"${CI_COMMIT_TAG}\" ] && git push github ${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
463
464 deploy_docs:
465   stage: host_test
466   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
467   tags:
468     - deploy
469   only:
470    - master
471    - /^release\/v/
472    - /^v\d+\.\d+(\.\d+)?($|-)/
473    - triggers
474   dependencies:
475     - build_docs
476   before_script: *do_nothing_before
477   script:
478     - mkdir -p ~/.ssh
479     - chmod 700 ~/.ssh
480     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
481     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
482     - chmod 600 ~/.ssh/id_rsa
483     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
484     - export GIT_VER=$(git describe --always)
485     - cd docs/en/_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/en
489     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
490     - cd ../../zh_CN/_build/
491     - mv html $GIT_VER
492     - tar czvf $GIT_VER.tar.gz $GIT_VER
493     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
494     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
495     # add link to preview doc
496     - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
497     - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
498
499 check_doc_links:
500   stage: host_test
501   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
502   tags:
503     - check_doc_links
504   only:
505     # can only be triggered
506     - triggers
507   artifacts:
508     paths:
509       - docs/_build/linkcheck
510     expire_in: 1 mos
511   script:
512     # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
513     - test "$CHECK_LINKS" = "Yes" || exit 0
514     # can only run on master branch (otherwise the commit is not on Github yet)
515     - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
516     - cd docs
517     - make linkcheck
518
519 check_line_endings:
520   stage: deploy
521   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
522   tags:
523     - build
524   except:
525     - master
526     - /^release\/v/
527     - /^v\d+\.\d+(\.\d+)?($|-)/
528   dependencies: []
529   before_script: *do_nothing_before
530   script:
531     - tools/ci/check-line-endings.sh ${IDF_PATH}
532
533 check_commit_msg:
534   stage: deploy
535   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
536   tags:
537     - build
538   except:
539     - master
540     - /^release\/v/
541     - /^v\d+\.\d+(\.\d+)?($|-)/
542   dependencies: []
543   before_script: *do_nothing_before
544   script:
545     - git status
546     - git log -n10 --oneline
547     # commit start with "WIP: " need to be squashed before merge
548     - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
549
550 check_permissions:
551   stage: deploy
552   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
553   tags:
554     - build
555   except:
556     - master
557     - /^release\/v/
558     - /^v\d+\.\d+(\.\d+)?($|-)/
559   dependencies: []
560   before_script: *do_nothing_before
561   script:
562     - tools/ci/check-executable.sh
563
564 check_examples_cmake_make:
565   stage: deploy
566   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
567   tags:
568     - build
569   except:
570     - master
571     - /^release\/v/
572     - /^v\d+\.\d+(\.\d+)?($|-)/
573   dependencies: []
574   before_script: *do_nothing_before
575   script:
576     - tools/ci/check_examples_cmake_make.sh
577
578 check_submodule_sync:
579   stage: deploy
580   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
581   tags:
582     - build
583   except:
584     - master
585     - /^release\/v/
586     - /^v\d+\.\d+(\.\d+)?($|-)/
587   dependencies: []
588   variables:
589     GIT_STRATEGY: clone
590   before_script: *do_nothing_before
591   script:
592     # check if all submodules are correctly synced to public repostory
593     - git submodule update --init --recursive
594
595 assign_test:
596   tags:
597     - assign_test
598   image: $CI_DOCKER_REGISTRY/ubuntu-test-env
599   stage: assign_test
600   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
601   # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
602   dependencies:
603     - build_ssc_00
604     - build_ssc_01
605     - build_ssc_02
606     - build_esp_idf_tests
607   variables:
608     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
609     EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
610   artifacts:
611     paths:
612       - components/idf_test/*/CIConfigs
613       - components/idf_test/*/TC.sqlite
614       - $EXAMPLE_CONFIG_OUTPUT_PATH
615     expire_in: 1 mos
616   before_script: *add_gitlab_key_before
617   script:
618     # assign example tests
619     - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
620     # assign unit test cases
621     - 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
622     # clone test script to assign tests
623     - git clone $TEST_SCRIPT_REPOSITORY
624     - cd auto_test_script
625     - python $CHECKOUT_REF_SCRIPT auto_test_script
626     # assgin integration test cases
627     - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
628
629 .example_test_template: &example_test_template
630   stage: integration_test
631   when: on_success
632   only:
633     - master
634     - /^release\/v/
635     - /^v\d+\.\d+(\.\d+)?($|-)/
636     - triggers
637     - schedules
638   dependencies:
639     - assign_test
640     - build_examples_00
641     - build_examples_01
642     - build_examples_02
643     - build_examples_03
644     - build_examples_04
645     - build_examples_05
646     - build_examples_06
647     - build_examples_07
648   artifacts:
649     when: always
650     paths:
651       - $LOG_PATH
652     expire_in: 1 mos
653   variables:
654     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
655     TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
656     CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
657     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
658     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
659   script:
660     # first test if config file exists, if not exist, exit 0
661     - test -e $CONFIG_FILE || exit 0
662     # clone test env configs
663     - git clone $TEST_ENV_CONFIG_REPOSITORY
664     - cd ci-test-runner-configs
665     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
666     - cd $TEST_FW_PATH
667     # run test
668     - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
669
670 .unit_test_template: &unit_test_template
671   <<: *example_test_template
672   stage: unit_test
673   dependencies:
674     - assign_test
675     - build_esp_idf_tests
676   variables:
677     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
678     TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
679     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
680     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
681     ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
682
683 .test_template: &test_template
684   stage: integration_test
685   when: on_success
686   only:
687     - master
688     - /^release\/v/
689     - /^v\d+\.\d+(\.\d+)?($|-)/
690     - triggers
691     - schedules
692   dependencies:
693     - assign_test
694     - build_ssc_00
695     - build_ssc_01
696     - build_ssc_02
697   artifacts:
698     when: always
699     paths:
700       - $LOG_PATH
701     expire_in: 1 mos
702   variables:
703     LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
704     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
705     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
706     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
707     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
708   before_script: *add_gitlab_key_before
709   script:
710     # first test if config file exists, if not exist, exit 0
711     - test -e $CONFIG_FILE || exit 0
712     # clone local test env configs
713     - git clone $TEST_ENV_CONFIG_REPOSITORY
714     - cd ci-test-runner-configs
715     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
716     # clone test bench
717     - git clone $TEST_SCRIPT_REPOSITORY
718     - cd auto_test_script
719     - python $CHECKOUT_REF_SCRIPT auto_test_script
720     # run test
721     - 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
722
723 nvs_compatible_test:
724   <<: *test_template
725   artifacts:
726     when: always
727     paths:
728       - $LOG_PATH
729       - nvs_wifi.bin
730     expire_in: 1 mos
731   tags:
732     - ESP32_IDF
733     - NVS_Compatible
734   script:
735     # clone local test env configs
736     - git clone $TEST_ENV_CONFIG_REPOSITORY
737     - cd ci-test-runner-configs
738     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
739     # clone test bench
740     - git clone $TEST_SCRIPT_REPOSITORY
741     - cd auto_test_script
742     - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
743     # prepare nvs bins
744     - ./Tools/prepare_nvs_bin.sh
745     # run test
746     - 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
747
748 example_test_001_01:
749   <<: *example_test_template
750   tags:
751     - ESP32
752     - Example_WIFI
753
754 example_test_002_01:
755   <<: *example_test_template
756   tags:
757     - ESP32
758     - Example_ShieldBox
759
760 example_test_003_01:
761   <<: *example_test_template
762   tags:
763     - ESP32
764     - Example_SDIO
765
766 example_test_004_01:
767   <<: *example_test_template
768   tags:
769     - ESP32
770     - Example_CAN
771
772 UT_001_01:
773   <<: *unit_test_template
774   tags:
775     - ESP32_IDF
776     - UT_T1_1
777
778 UT_001_02:
779   <<: *unit_test_template
780   tags:
781     - ESP32_IDF
782     - UT_T1_1
783
784 UT_001_03:
785   <<: *unit_test_template
786   tags:
787     - ESP32_IDF
788     - UT_T1_1
789
790 UT_001_04:
791   <<: *unit_test_template
792   tags:
793     - ESP32_IDF
794     - UT_T1_1
795
796 UT_001_05:
797   <<: *unit_test_template
798   tags:
799     - ESP32_IDF
800     - UT_T1_1
801
802 UT_001_06:
803   <<: *unit_test_template
804   tags:
805     - ESP32_IDF
806     - UT_T1_1
807
808 UT_001_07:
809   <<: *unit_test_template
810   tags:
811     - ESP32_IDF
812     - UT_T1_1
813
814 UT_001_08:
815   <<: *unit_test_template
816   tags:
817     - ESP32_IDF
818     - UT_T1_1
819
820 UT_001_09:
821   <<: *unit_test_template
822   tags:
823     - ESP32_IDF
824     - UT_T1_1
825
826 UT_001_10:
827   <<: *unit_test_template
828   tags:
829     - ESP32_IDF
830     - UT_T1_1
831
832 UT_001_11:
833   <<: *unit_test_template
834   tags:
835     - ESP32_IDF
836     - UT_T1_1
837
838 UT_001_12:
839   <<: *unit_test_template
840   tags:
841     - ESP32_IDF
842     - UT_T1_1
843
844 UT_001_13:
845   <<: *unit_test_template
846   tags:
847     - ESP32_IDF
848     - UT_T1_1
849
850 UT_001_14:
851   <<: *unit_test_template
852   tags:
853     - ESP32_IDF
854     - UT_T1_1
855
856 UT_001_15:
857   <<: *unit_test_template
858   tags:
859     - ESP32_IDF
860     - UT_T1_1
861
862 UT_001_16:
863   <<: *unit_test_template
864   tags:
865     - ESP32_IDF
866     - UT_T1_1
867
868 UT_001_17:
869   <<: *unit_test_template
870   tags:
871     - ESP32_IDF
872     - UT_T1_1
873
874 UT_001_18:
875   <<: *unit_test_template
876   tags:
877     - ESP32_IDF
878     - UT_T1_1
879
880 UT_001_19:
881   <<: *unit_test_template
882   tags:
883     - ESP32_IDF
884     - UT_T1_1
885
886 UT_001_20:
887   <<: *unit_test_template
888   tags:
889     - ESP32_IDF
890     - UT_T1_1
891
892 UT_001_21:
893   <<: *unit_test_template
894   tags:
895     - ESP32_IDF
896     - UT_T1_1
897
898 UT_001_22:
899   <<: *unit_test_template
900   tags:
901     - ESP32_IDF
902     - UT_T1_1
903
904 UT_001_23:
905   <<: *unit_test_template
906   tags:
907     - ESP32_IDF
908     - UT_T1_1
909
910 UT_001_24:
911   <<: *unit_test_template
912   tags:
913     - ESP32_IDF
914     - UT_T1_1
915
916 UT_001_25:
917   <<: *unit_test_template
918   tags:
919     - ESP32_IDF
920     - UT_T1_1
921     
922 UT_001_26:
923   <<: *unit_test_template
924   tags:
925     - ESP32_IDF
926     - UT_T1_1
927
928 UT_001_27:
929   <<: *unit_test_template
930   tags:
931     - ESP32_IDF
932     - UT_T1_1
933
934 UT_001_28:
935   <<: *unit_test_template
936   tags:
937     - ESP32_IDF
938     - UT_T1_1
939
940 UT_001_29:
941   <<: *unit_test_template
942   tags:
943     - ESP32_IDF
944     - UT_T1_1
945
946 UT_001_30:
947   <<: *unit_test_template
948   tags:
949     - ESP32_IDF
950     - UT_T1_1
951
952 UT_001_31:
953   <<: *unit_test_template
954   tags:
955     - ESP32_IDF
956     - UT_T1_1
957     
958 UT_001_32:
959   <<: *unit_test_template
960   tags:
961     - ESP32_IDF
962     - UT_T1_1
963
964 UT_001_33:
965   <<: *unit_test_template
966   tags:
967     - ESP32_IDF
968     - UT_T1_1
969     
970 UT_001_34:
971   <<: *unit_test_template
972   tags:
973     - ESP32_IDF
974     - UT_T1_1
975
976 UT_001_35:
977   <<: *unit_test_template
978   tags:
979     - ESP32_IDF
980     - UT_T1_1
981
982 UT_001_36:
983   <<: *unit_test_template
984   tags:
985     - ESP32_IDF
986     - UT_T1_1
987
988 UT_002_01:
989   <<: *unit_test_template
990   tags:
991     - ESP32_IDF
992     - UT_T1_SDMODE
993
994 UT_002_02:
995   <<: *unit_test_template
996   tags:
997     - ESP32_IDF
998     - UT_T1_SDMODE
999
1000 UT_002_03:
1001   <<: *unit_test_template
1002   tags:
1003     - ESP32_IDF
1004     - UT_T1_SDMODE
1005
1006 UT_003_01:
1007   <<: *unit_test_template
1008   tags:
1009     - ESP32_IDF
1010     - UT_T1_SPIMODE
1011
1012 UT_003_02:
1013   <<: *unit_test_template
1014   tags:
1015     - ESP32_IDF
1016     - UT_T1_SPIMODE
1017
1018 UT_003_03:
1019   <<: *unit_test_template
1020   tags:
1021     - ESP32_IDF
1022     - UT_T1_SPIMODE
1023
1024 UT_004_01:
1025   <<: *unit_test_template
1026   tags:
1027     - ESP32_IDF
1028     - UT_T1_1
1029     - psram
1030
1031 UT_004_02:
1032   <<: *unit_test_template
1033   tags:
1034     - ESP32_IDF
1035     - UT_T1_1
1036     - psram
1037
1038 UT_004_03:
1039   <<: *unit_test_template
1040   tags:
1041     - ESP32_IDF
1042     - UT_T1_1
1043     - psram
1044
1045 UT_004_04:
1046   <<: *unit_test_template
1047   tags:
1048     - ESP32_IDF
1049     - UT_T1_1
1050     - psram
1051
1052 UT_004_05:
1053   <<: *unit_test_template
1054   tags:
1055     - ESP32_IDF
1056     - UT_T1_1
1057     - psram
1058
1059 UT_004_06:
1060   <<: *unit_test_template
1061   tags:
1062     - ESP32_IDF
1063     - UT_T1_1
1064     - psram
1065
1066 UT_004_07:
1067   <<: *unit_test_template
1068   tags:
1069     - ESP32_IDF
1070     - UT_T1_1
1071     - psram
1072
1073 UT_004_08:
1074   <<: *unit_test_template
1075   tags:
1076     - ESP32_IDF
1077     - UT_T1_1
1078     - psram
1079
1080 UT_004_09:
1081   <<: *unit_test_template
1082   tags:
1083     - ESP32_IDF
1084     - UT_T1_1
1085     - psram
1086
1087 UT_004_10:
1088   <<: *unit_test_template
1089   tags:
1090     - ESP32_IDF
1091     - UT_T1_1
1092     - psram
1093     
1094 UT_004_11:
1095   <<: *unit_test_template
1096   tags:
1097     - ESP32_IDF
1098     - UT_T1_1
1099     - psram
1100     
1101 UT_005_01:
1102   <<: *unit_test_template
1103   tags:
1104     - ESP32_IDF
1105     - UT_T1_SDMODE
1106     - psram
1107
1108 UT_005_02:
1109   <<: *unit_test_template
1110   tags:
1111     - ESP32_IDF
1112     - UT_T1_SPIMODE
1113     - psram
1114
1115 UT_006_01:
1116   <<: *unit_test_template
1117   tags:
1118     - ESP32_IDF
1119     - UT_T1_GPIO
1120
1121 UT_006_02:
1122   <<: *unit_test_template
1123   tags:
1124     - ESP32_IDF
1125     - UT_T1_GPIO
1126
1127 UT_006_03:
1128   <<: *unit_test_template
1129   tags:
1130     - ESP32_IDF
1131     - UT_T1_GPIO
1132
1133 UT_006_04:
1134   <<: *unit_test_template
1135   tags:
1136     - ESP32_IDF
1137     - UT_T1_GPIO
1138     - psram
1139
1140 UT_007_01:
1141   <<: *unit_test_template
1142   tags:
1143     - ESP32_IDF
1144     - UT_T1_PCNT
1145
1146 UT_007_02:
1147   <<: *unit_test_template
1148   tags:
1149     - ESP32_IDF
1150     - UT_T1_PCNT
1151
1152 UT_007_03:
1153   <<: *unit_test_template
1154   tags:
1155     - ESP32_IDF
1156     - UT_T1_PCNT
1157
1158 UT_007_04:
1159   <<: *unit_test_template
1160   tags:
1161     - ESP32_IDF
1162     - UT_T1_PCNT
1163     - psram
1164
1165 UT_008_01:
1166   <<: *unit_test_template
1167   tags:
1168     - ESP32_IDF
1169     - UT_T1_LEDC
1170
1171 UT_008_02:
1172   <<: *unit_test_template
1173   tags:
1174     - ESP32_IDF
1175     - UT_T1_LEDC
1176
1177 UT_008_03:
1178   <<: *unit_test_template
1179   tags:
1180     - ESP32_IDF
1181     - UT_T1_LEDC
1182
1183 UT_008_04:
1184   <<: *unit_test_template
1185   tags:
1186     - ESP32_IDF
1187     - UT_T1_LEDC
1188     - psram
1189
1190 UT_010_01:
1191   <<: *unit_test_template
1192   tags:
1193     - ESP32_IDF
1194     - UT_T1_RMT
1195
1196 UT_010_02:
1197   <<: *unit_test_template
1198   tags:
1199     - ESP32_IDF
1200     - UT_T1_RMT
1201
1202 UT_010_03:
1203   <<: *unit_test_template
1204   tags:
1205     - ESP32_IDF
1206     - UT_T1_RMT
1207
1208 UT_010_04:
1209   <<: *unit_test_template
1210   tags:
1211     - ESP32_IDF
1212     - UT_T1_RMT
1213     - psram
1214
1215 UT_601_01:
1216   <<: *unit_test_template
1217   tags:
1218     - ESP32_IDF
1219     - UT_T1_1
1220
1221 IT_001_01:
1222   <<: *test_template
1223   tags:
1224     - ESP32_IDF
1225     - SSC_T1_1
1226
1227 IT_001_02:
1228   <<: *test_template
1229   tags:
1230     - ESP32_IDF
1231     - SSC_T1_1
1232
1233 IT_001_03:
1234   <<: *test_template
1235   tags:
1236     - ESP32_IDF
1237     - SSC_T1_1
1238
1239 IT_001_04:
1240   <<: *test_template
1241   tags:
1242     - ESP32_IDF
1243     - SSC_T1_1
1244
1245 IT_001_05:
1246   <<: *test_template
1247   tags:
1248     - ESP32_IDF
1249     - SSC_T1_1
1250
1251 IT_001_06:
1252   <<: *test_template
1253   tags:
1254     - ESP32_IDF
1255     - SSC_T1_1
1256
1257 IT_001_07:
1258   <<: *test_template
1259   tags:
1260     - ESP32_IDF
1261     - SSC_T1_1
1262
1263 IT_001_08:
1264   <<: *test_template
1265   tags:
1266     - ESP32_IDF
1267     - SSC_T1_1
1268
1269 IT_001_09:
1270   <<: *test_template
1271   tags:
1272     - ESP32_IDF
1273     - SSC_T1_1
1274
1275 IT_002_01:
1276   <<: *test_template
1277   tags:
1278     - ESP32_IDF
1279     - SSC_T1_2
1280
1281 IT_003_01:
1282   <<: *test_template
1283   tags:
1284     - ESP32_IDF
1285     - SSC_T2_1
1286
1287 IT_003_02:
1288   <<: *test_template
1289   tags:
1290     - ESP32_IDF
1291     - SSC_T2_1
1292
1293 IT_003_03:
1294   <<: *test_template
1295   tags:
1296     - ESP32_IDF
1297     - SSC_T2_1
1298
1299 IT_003_04:
1300   <<: *test_template
1301   tags:
1302     - ESP32_IDF
1303     - SSC_T2_1
1304
1305 IT_003_05:
1306   <<: *test_template
1307   tags:
1308     - ESP32_IDF
1309     - SSC_T2_1
1310
1311 IT_003_06:
1312   <<: *test_template
1313   tags:
1314     - ESP32_IDF
1315     - SSC_T2_1
1316
1317 IT_003_07:
1318   <<: *test_template
1319   tags:
1320     - ESP32_IDF
1321     - SSC_T2_1
1322
1323 IT_003_08:
1324   <<: *test_template
1325   tags:
1326     - ESP32_IDF
1327     - SSC_T2_1
1328
1329 IT_003_09:
1330   <<: *test_template
1331   tags:
1332     - ESP32_IDF
1333     - SSC_T2_1
1334
1335 IT_003_10:
1336   <<: *test_template
1337   tags:
1338     - ESP32_IDF
1339     - SSC_T2_1
1340
1341 IT_003_11:
1342   <<: *test_template
1343   tags:
1344     - ESP32_IDF
1345     - SSC_T2_1
1346
1347 IT_003_12:
1348   <<: *test_template
1349   tags:
1350     - ESP32_IDF
1351     - SSC_T2_1
1352
1353 IT_003_13:
1354   <<: *test_template
1355   tags:
1356     - ESP32_IDF
1357     - SSC_T2_1
1358
1359 IT_003_14:
1360   <<: *test_template
1361   tags:
1362     - ESP32_IDF
1363     - SSC_T2_1
1364
1365 IT_004_01:
1366   <<: *test_template
1367   tags:
1368     - ESP32_IDF
1369     - SSC_T1_APC
1370
1371 IT_005_01:
1372   <<: *test_template
1373   tags:
1374     - ESP32_IDF
1375     - SSC_T1_WEP
1376
1377 IT_009_01:
1378   <<: *test_template
1379   tags:
1380     - ESP32_IDF
1381     - SSC_T1_3
1382
1383 IT_010_01:
1384   <<: *test_template
1385   tags:
1386     - ESP32_IDF
1387     - SSC_T5_1
1388
1389 IT_011_01:
1390   <<: *test_template
1391   tags:
1392     - ESP32_IDF
1393     - SSC_T50_1
1394
1395 IT_501_01:
1396   <<: *test_template
1397   tags:
1398     - ESP32_IDF
1399     - SSC_T1_1
1400     - stress_test
1401
1402 IT_501_02:
1403   <<: *test_template
1404   tags:
1405     - ESP32_IDF
1406     - SSC_T1_1
1407     - stress_test
1408
1409 IT_501_03:
1410   <<: *test_template
1411   tags:
1412     - ESP32_IDF
1413     - SSC_T1_1
1414     - stress_test
1415
1416 IT_502_01:
1417   <<: *test_template
1418   tags:
1419     - ESP32_IDF
1420     - SSC_T2_1
1421     - stress_test
1422
1423 IT_502_02:
1424   <<: *test_template
1425   tags:
1426     - ESP32_IDF
1427     - SSC_T2_1
1428     - stress_test
1429
1430 IT_503_01:
1431   <<: *test_template
1432   tags:
1433     - ESP32_IDF
1434     - SSC_T5_1
1435     - stress_test
1436
1437 IT_503_02:
1438   <<: *test_template
1439   tags:
1440     - ESP32_IDF
1441     - SSC_T5_1
1442     - stress_test
1443
1444 IT_503_03:
1445   <<: *test_template
1446   tags:
1447     - ESP32_IDF
1448     - SSC_T5_1
1449     - stress_test