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