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