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