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