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