]> granicus.if.org Git - esp-idf/blob - .gitlab-ci.yml
Fix "undefined variable which git" warning when submodules not initialized
[esp-idf] / .gitlab-ci.yml
1 stages:
2   - build
3   - assign_test
4   - unit_test
5   - test
6   - test_report
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 # before each job, we need to check if this job is filtered by bot stage/job filter
35 .apply_bot_filter: &apply_bot_filter
36   python $APPLY_BOT_FILTER_SCRIPT || exit 0
37
38 before_script:
39   # apply bot filter in before script
40   - *apply_bot_filter
41   # add gitlab ssh key
42   - mkdir -p ~/.ssh
43   - chmod 700 ~/.ssh
44   - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
45   - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
46   - chmod 600 ~/.ssh/id_rsa
47   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
48
49   # Set IS_PRIVATE or IS_PUBLIC depending on if our branch is public or not
50   #
51   # (the same regular expressions are used to set these are used in 'only:' sections below
52   - source tools/ci/configure_ci_environment.sh
53
54   # fetch the submodules (& if necessary re-fetch repo) from gitlab
55   - time ./tools/ci/get-full-sources.sh
56
57 .do_nothing_before:
58   before_script: &do_nothing_before
59     # apply bot filter in before script
60     - *apply_bot_filter
61     - echo "Not setting up GitLab key, not fetching submodules"
62     - source tools/ci/configure_ci_environment.sh
63
64 .add_gitlab_key_before:
65   before_script: &add_gitlab_key_before
66     # apply bot filter in before script
67     - *apply_bot_filter
68     - echo "Not fetching submodules"
69     - source tools/ci/configure_ci_environment.sh
70     # add gitlab ssh key
71     - mkdir -p ~/.ssh
72     - chmod 700 ~/.ssh
73     - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
74     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
75     - chmod 600 ~/.ssh/id_rsa
76     - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
77
78 build_template_app:
79   stage: build
80   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
81   tags:
82     - build
83   variables:
84     BATCH_BUILD: "1"
85     IDF_CI_BUILD: "1"
86   script:
87     - git clone https://github.com/espressif/esp-idf-template.git
88     - cd esp-idf-template
89     # Try to use the same branch name for esp-idf-template that we're
90     # using on esp-idf. If it doesn't exist then just stick to the default
91     # branch
92     - python $CHECKOUT_REF_SCRIPT esp-idf-template
93     # Test debug build (default)
94     - make all V=1
95     # Now test release build
96     - make clean
97     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
98     - make all V=1
99     # Check if there are any stray printf/ets_printf references in WiFi libs
100     - cd ../components/esp32/lib
101     - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
102     - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
103
104
105 .build_template: &build_template
106   stage: build
107   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
108   tags:
109     - build
110   variables:
111     BATCH_BUILD: "1"
112     V: "0"
113
114 .build_ssc_template: &build_ssc_template
115   <<: *build_template
116   artifacts:
117     paths:
118       - SSC/ssc_bin
119     expire_in: 1 mos
120   variables:
121     SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF"
122   script:
123     - git clone $SSC_REPOSITORY
124     - cd SSC
125     - python $CHECKOUT_REF_SCRIPT SSC
126     - MAKEFLAGS= ./ci_build_ssc.sh "${CI_JOB_NAME}" "${IDF_PATH}/.gitlab-ci.yml"
127
128 # don't forget to add to dependency to test_template when adding new build_ssc jobs
129 build_ssc_00:
130   <<: *build_ssc_template
131
132 build_ssc_01:
133   <<: *build_ssc_template
134
135 build_ssc_02:
136   <<: *build_ssc_template
137
138 build_esp_idf_tests:
139   <<: *build_template
140   artifacts:
141     paths:
142       - tools/unit-test-app/output
143       - components/idf_test/unit_test/TestCaseAll.yml
144       - components/idf_test/unit_test/CIConfigs/*.yml
145     expire_in: 6 mos
146   script:
147     - cd tools/unit-test-app
148     - make help # make sure kconfig tools are built in single process
149     - make ut-clean-all-configs
150     - export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
151     - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
152     - make ut-build-all-configs TESTS_ALL=1
153     - python tools/UnitTestParser.py
154
155 .build_examples_template: &build_examples_template
156   <<: *build_template
157   retry: 1
158   artifacts:
159     when: always
160     paths:
161       - build_examples/*/*/*/build/*.bin
162       - build_examples/*/*/*/build/*.elf
163       - build_examples/*/*/*/build/*.map
164       - build_examples/*/*/*/build/download.config
165       - build_examples/*/*/*/build/bootloader/*.bin
166       - $LOG_PATH
167     expire_in: 1 week
168   variables:
169     IDF_CI_BUILD: "1"
170     LOG_PATH: "$CI_PROJECT_DIR/log_examples"
171   script:
172     # it's not possible to build 100% out-of-tree and have the "artifacts"
173     # mechanism work, but this is the next best thing
174     - rm -rf build_examples
175     - mkdir build_examples
176     - cd build_examples
177     # build some of examples
178     - mkdir -p ${LOG_PATH}
179     - ${IDF_PATH}/tools/ci/build_examples.sh "${CI_JOB_NAME}"
180
181 build_examples_00:
182   <<: *build_examples_template
183
184 build_examples_01:
185   <<: *build_examples_template
186
187 build_examples_02:
188   <<: *build_examples_template
189
190 build_examples_03:
191   <<: *build_examples_template
192
193 build_examples_04:
194   <<: *build_examples_template
195
196 build_examples_05:
197   <<: *build_examples_template
198
199 build_examples_06:
200   <<: *build_examples_template
201
202 build_examples_07:
203   <<: *build_examples_template
204
205
206 build_docs:
207   stage: build
208   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
209   tags:
210     - build_docs
211   artifacts:
212     when: always
213     paths:
214       # English version of documentation
215       - docs/en/doxygen-warning-log.txt
216       - docs/en/sphinx-warning-log.txt
217       - docs/en/sphinx-warning-log-sanitized.txt
218       - docs/en/_build/html
219       # Chinese version of documentation
220       - docs/zh_CN/doxygen-warning-log.txt
221       - docs/zh_CN/sphinx-warning-log.txt
222       - docs/zh_CN/sphinx-warning-log-sanitized.txt
223       - docs/zh_CN/_build/html
224     expire_in: 1 mos
225   script:
226     - cd docs
227     - ./check_lang_folder_sync.sh
228     - cd en
229     - make gh-linkcheck
230     - make html
231     - ../check_doc_warnings.sh
232     - cd ../zh_CN
233     - make gh-linkcheck
234     - make html
235     - ../check_doc_warnings.sh
236
237 test_nvs_on_host:
238   stage: test
239   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
240   tags:
241     - nvs_host_test
242   dependencies: []
243   script:
244     - cd components/nvs_flash/test_nvs_host
245     - make test
246
247 test_nvs_coverage:
248   stage: test
249   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
250   tags:
251     - nvs_host_test
252   dependencies: []
253   artifacts:
254     paths:
255       - components/nvs_flash/test_nvs_host/coverage_report
256   only:
257     - triggers
258   # This job takes a few hours to finish, so only run it on demand
259   variables:
260     BOT_NEEDS_TRIGGER_BY_NAME: 1
261   script:
262     - cd components/nvs_flash/test_nvs_host
263     - make coverage_report
264
265 test_partition_table_on_host:
266   stage: test
267   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
268   tags:
269     - build
270   dependencies: []
271   script:
272     - cd components/partition_table/test_gen_esp32part_host
273     - ./gen_esp32part_tests.py
274
275 test_wl_on_host:
276   stage: test
277   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
278   tags:
279     - wl_host_test
280   artifacts:
281     paths:
282       - components/wear_levelling/test_wl_host/coverage_report.zip
283   dependencies: []
284   script:
285     - cd components/wear_levelling/test_wl_host
286     - make test
287
288 test_multi_heap_on_host:
289   stage: test
290   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
291   tags:
292     - wl_host_test
293   script:
294     - cd components/heap/test_multi_heap_host
295     - ./test_all_configs.sh
296
297 test_build_system:
298   stage: test
299   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
300   tags:
301     - build_test
302   dependencies: []
303   script:
304     - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
305     - rm -rf test_build_system
306     - mkdir test_build_system
307     - cd test_build_system
308     - ${IDF_PATH}/tools/ci/test_build_system.sh
309
310 test_report:
311   stage: test_report
312   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
313   tags:
314     - report
315   only:
316     - master
317     - triggers
318     - schedules
319     - /^release\/v/
320     - /^v\d+\.\d+(\.\d+)?($|-)/
321   variables:
322     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
323     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test"
324     REPORT_PATH: "$CI_PROJECT_DIR/CI_Test_Report"
325     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/tools/unit-test-app/tools/ModuleDefinition.yml"
326   #dependencies:
327   #We need all UT* and IT* artifacts except for only a few other
328   artifacts:
329     when: always
330     paths:
331       - $REPORT_PATH
332       - $LOG_PATH
333     expire_in: 12 mos
334   script:
335     # calc log path
336     - VER_NUM=`git rev-list HEAD | wc -l | awk '{print $1}'`
337     - SHA_ID=`echo $CI_COMMIT_SHA | cut -c 1-7`
338     - REVISION="${VER_NUM}_${SHA_ID}"
339     # replace / to _ in branch name
340     - ESCAPED_BRANCH_NAME=`echo $CI_COMMIT_REF_NAME | sed 's/\//___/g'`
341     # result path and artifacts path
342     - RESULT_PATH="$CI_PROJECT_NAME/$ESCAPED_BRANCH_NAME/$REVISION"
343     - ARTIFACTS_PATH="$GITLAB_HTTP_SERVER/idf/esp-idf/builds/$CI_JOB_ID/artifacts/browse/$CI_COMMIT_SHA"
344     # clone test bench
345     - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git
346     - cd auto_test_script
347     - python $CHECKOUT_REF_SCRIPT auto_test_script
348     # generate report
349     - TEST_RESULT=Pass
350     - python CITestReport.py -l $LOG_PATH -t $TEST_CASE_FILE_PATH -p $REPORT_PATH -r $RESULT_PATH -a $ARTIFACTS_PATH -m $MODULE_UPDATE_FILE || TEST_RESULT=Fail
351     # commit to CI-test-result project
352     - git clone $GITLAB_SSH_SERVER/qa/CI-test-result.git
353     - rm -rf "CI-test-result/RawData/$RESULT_PATH"
354     - cp -R $CI_PROJECT_NAME CI-test-result/RawData
355     - cd CI-test-result
356     # config git user
357     - git config --global user.email "ci-test-result@espressif.com"
358     - git config --global user.name "ci-test-result"
359     # commit test result
360     - git add .
361     - git commit . -m "update test result for $CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA, pipeline ID $CI_PIPELINE_ID" || exit 0
362     - git push origin master
363     - test "${TEST_RESULT}" = "Pass" || exit 1
364
365 test_esp_err_to_name_on_host:
366   stage: test
367   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
368   tags:
369     - build
370   dependencies: []
371   script:
372     - cd tools/
373     - ./gen_esp_err_to_name.py
374     - 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)
375
376 push_master_to_github:
377   stage: deploy
378   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
379   tags:
380     - deploy
381   only:
382     - master
383     - /^release\/v/
384     - /^v\d+\.\d+(\.\d+)?($|-)/
385   when: on_success
386   dependencies: []
387   variables:
388     GITHUB_PUSH_REFS: refs/remotes/origin/release refs/remotes/origin/master
389   before_script: *do_nothing_before
390   script:
391     - mkdir -p ~/.ssh
392     - chmod 700 ~/.ssh
393     - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
394     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
395     - chmod 600 ~/.ssh/id_rsa
396     - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
397     - git remote remove github &>/dev/null || true
398     - git remote add github git@github.com:espressif/esp-idf.git
399     # What the next line of script does: goes through the list of refs for all branches we push to github,
400     # generates a snippet of shell which is evaluated. The snippet checks CI_COMMIT_SHA against the SHA
401     # (aka objectname) at tip of each branch, and if any SHAs match then it checks out the local branch
402     # and then pushes that ref to a corresponding github branch
403     - eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)
404
405
406 deploy_docs:
407   stage: assign_test
408   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
409   tags:
410     - deploy
411   only:
412    - master
413    - /^release\/v/
414    - /^v\d+\.\d+(\.\d+)?($|-)/
415    - triggers
416   dependencies:
417     - build_docs
418   before_script: *do_nothing_before
419   script:
420     - mkdir -p ~/.ssh
421     - chmod 700 ~/.ssh
422     - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
423     - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
424     - chmod 600 ~/.ssh/id_rsa
425     - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
426     - export GIT_VER=$(git describe --always)
427     - cd docs/en/_build/
428     - mv html $GIT_VER
429     - tar czvf $GIT_VER.tar.gz $GIT_VER
430     - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
431     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
432     - cd ../../zh_CN/_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/zh_CN
436     - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
437     # add link to preview doc
438     - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
439     - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
440
441 check_doc_links:
442   stage: test
443   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
444   tags:
445     - check_doc_links
446   only:
447     # can only be triggered
448     - triggers
449   artifacts:
450     paths:
451       - docs/_build/linkcheck
452     expire_in: 1 mos
453   script:
454     # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
455     - test "$CHECK_LINKS" = "Yes" || exit 0
456     # can only run on master branch (otherwise the commit is not on Github yet)
457     - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
458     - cd docs
459     - make linkcheck
460
461 check_commit_msg:
462   stage: deploy
463   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
464   tags:
465     - build
466   except:
467     - master
468     - /^release\/v/
469     - /^v\d+\.\d+(\.\d+)?($|-)/
470   dependencies: []
471   before_script: *do_nothing_before
472   script:
473     - git status
474     - git log -n10 --oneline
475     # commit start with "WIP: " need to be squashed before merge
476     - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
477
478 check_submodule_sync:
479   stage: deploy
480   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
481   tags:
482     - build
483   except:
484     - master
485     - /^release\/v/
486     - /^v\d+\.\d+(\.\d+)?($|-)/
487   dependencies: []
488   variables:
489     GIT_STRATEGY: clone
490   before_script: *do_nothing_before
491   script:
492     # check if all submodules are correctly synced to public repostory
493     - git submodule update --init --recursive
494
495 assign_test:
496   <<: *build_template
497   stage: assign_test
498   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
499   # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
500   variables:
501     UT_BIN_PATH: "tools/unit-test-app/output"
502     OUTPUT_BIN_PATH: "test_bins/ESP32_IDF"
503     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
504     EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
505   artifacts:
506     paths:
507       - $OUTPUT_BIN_PATH
508       - components/idf_test/*/CIConfigs
509       - components/idf_test/*/TC.sqlite
510       - $EXAMPLE_CONFIG_OUTPUT_PATH
511       - tools/unit-test-app/output
512     expire_in: 1 mos
513   before_script: *add_gitlab_key_before
514   script:
515     # first move test bins together: test_bins/CHIP_SDK/TestApp/bin_files
516     - mkdir -p $OUTPUT_BIN_PATH
517     - cp -r SSC/ssc_bin/* $OUTPUT_BIN_PATH
518     # assign example tests
519     - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
520     # assign unit test cases
521     - 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
522     # clone test script to assign tests
523     - git clone $TEST_SCRIPT_REPOSITORY
524     - cd auto_test_script
525     - python $CHECKOUT_REF_SCRIPT auto_test_script
526     # assgin integration test cases
527     - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
528
529 .example_test_template: &example_test_template
530   stage: test
531   when: on_success
532   only:
533     - master
534     - /^release\/v/
535     - /^v\d+\.\d+(\.\d+)?($|-)/
536     - triggers
537     - schedules
538   # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
539   # we have a lot build example jobs and the binaries them exceed the limitation of artifacts.
540   # we can't artifact them in one job. For example test jobs, download all artifacts from previous stages.
541   artifacts:
542     when: always
543     paths:
544       - $LOG_PATH
545     expire_in: 6 mos
546   variables:
547     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
548     TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
549     CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
550     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
551   script:
552     # first test if config file exists, if not exist, exit 0
553     - test -e $CONFIG_FILE || exit 0
554     - cd $TEST_FW_PATH
555     # run test
556     - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE
557
558 .unit_test_template: &unit_test_template
559   <<: *example_test_template
560   stage: unit_test
561   dependencies:
562     - assign_test
563   variables:
564     TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
565     TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
566     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
567     LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
568
569 .test_template: &test_template
570   stage: test
571   when: on_success
572   only:
573     - master
574     - /^release\/v/
575     - /^v\d+\.\d+(\.\d+)?($|-)/
576     - triggers
577     - schedules
578   allow_failure: true
579   dependencies:
580     - assign_test
581     - build_ssc_00
582     - build_ssc_01
583     - build_ssc_02
584   artifacts:
585     when: always
586     paths:
587       - $LOG_PATH
588     expire_in: 6 mos
589   variables:
590     LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
591     LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
592     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
593     MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
594     CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
595   before_script: *add_gitlab_key_before
596   script:
597     # first test if config file exists, if not exist, exit 0
598     - test -e $CONFIG_FILE || exit 0
599     # clone local test env configs
600     - git clone $TEST_ENV_CONFIG_REPOSITORY
601     - cd ci-test-runner-configs
602     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
603     # clone test bench
604     - git clone $TEST_SCRIPT_REPOSITORY
605     - cd auto_test_script
606     - python $CHECKOUT_REF_SCRIPT auto_test_script
607     # run test
608     - 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
609
610 nvs_compatible_test:
611   <<: *test_template
612   artifacts:
613     when: always
614     paths:
615       - $LOG_PATH
616       - nvs_wifi.bin
617     expire_in: 6 mos
618   tags:
619     - ESP32_IDF
620     - NVS_Compatible
621   script:
622     # clone local test env configs
623     - git clone $TEST_ENV_CONFIG_REPOSITORY
624     - cd ci-test-runner-configs
625     - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
626     # clone test bench
627     - git clone $TEST_SCRIPT_REPOSITORY
628     - cd auto_test_script
629     - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
630     # prepare nvs bins
631     - ./Tools/prepare_nvs_bin.sh
632     # run test
633     - 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
634
635 example_test_001_01:
636   <<: *example_test_template
637   tags:
638     - ESP32
639     - Example_WIFI
640
641 UT_001_01:
642   <<: *unit_test_template
643   tags:
644     - ESP32_IDF
645     - UT_T1_1
646     - UT_default
647
648 UT_001_02:
649   <<: *unit_test_template
650   tags:
651     - ESP32_IDF
652     - UT_T1_1
653     - UT_default
654
655 UT_001_03:
656   <<: *unit_test_template
657   tags:
658     - ESP32_IDF
659     - UT_T1_1
660     - UT_default
661
662 UT_001_04:
663   <<: *unit_test_template
664   tags:
665     - ESP32_IDF
666     - UT_T1_1
667     - UT_default
668
669 UT_001_05:
670   <<: *unit_test_template
671   tags:
672     - ESP32_IDF
673     - UT_T1_SDMODE
674     - UT_default
675
676 UT_001_06:
677   <<: *unit_test_template
678   tags:
679     - ESP32_IDF
680     - UT_T1_SPIMODE
681     - UT_default
682
683 UT_001_07:
684   <<: *unit_test_template
685   tags:
686     - ESP32_IDF
687     - UT_T1_1
688     - UT_default
689
690 UT_001_08:
691   <<: *unit_test_template
692   tags:
693     - ESP32_IDF
694     - UT_T1_1
695     - UT_default
696
697 UT_001_09:
698   <<: *unit_test_template
699   tags:
700     - ESP32_IDF
701     - UT_T1_1
702     - UT_default
703
704 UT_001_10:
705   <<: *unit_test_template
706   tags:
707     - ESP32_IDF
708     - UT_T1_1
709     - UT_default
710
711 UT_002_01:
712   <<: *unit_test_template
713   tags:
714     - ESP32_IDF
715     - UT_T1_1
716     - UT_release
717
718 UT_002_02:
719   <<: *unit_test_template
720   tags:
721     - ESP32_IDF
722     - UT_T1_1
723     - UT_release
724
725 UT_002_03:
726   <<: *unit_test_template
727   tags:
728     - ESP32_IDF
729     - UT_T1_1
730     - UT_release
731
732 UT_002_04:
733   <<: *unit_test_template
734   tags:
735     - ESP32_IDF
736     - UT_T1_1
737     - UT_release
738
739 UT_002_05:
740   <<: *unit_test_template
741   tags:
742     - ESP32_IDF
743     - UT_T1_SDMODE
744     - UT_release
745
746 UT_002_06:
747   <<: *unit_test_template
748   tags:
749     - ESP32_IDF
750     - UT_T1_SPIMODE
751     - UT_release
752
753 UT_002_07:
754   <<: *unit_test_template
755   tags:
756     - ESP32_IDF
757     - UT_T1_1
758     - UT_release
759
760 UT_002_08:
761   <<: *unit_test_template
762   tags:
763     - ESP32_IDF
764     - UT_T1_1
765     - UT_release
766
767 UT_002_09:
768   <<: *unit_test_template
769   tags:
770     - ESP32_IDF
771     - UT_T1_1
772     - UT_release
773
774 UT_002_10:
775   <<: *unit_test_template
776   tags:
777     - ESP32_IDF
778     - UT_T1_1
779     - UT_release
780
781 UT_003_01:
782   <<: *unit_test_template
783   tags:
784     - ESP32_IDF
785     - UT_T1_1
786     - UT_single_core
787
788 UT_003_02:
789   <<: *unit_test_template
790   tags:
791     - ESP32_IDF
792     - UT_T1_1
793     - UT_single_core
794
795 UT_003_03:
796   <<: *unit_test_template
797   tags:
798     - ESP32_IDF
799     - UT_T1_1
800     - UT_single_core
801
802 UT_003_04:
803   <<: *unit_test_template
804   tags:
805     - ESP32_IDF
806     - UT_T1_1
807     - UT_single_core
808
809 UT_003_05:
810   <<: *unit_test_template
811   tags:
812     - ESP32_IDF
813     - UT_T1_SDMODE
814     - UT_single_core
815
816 UT_003_06:
817   <<: *unit_test_template
818   tags:
819     - ESP32_IDF
820     - UT_T1_SPIMODE
821     - UT_single_core
822
823 UT_003_07:
824   <<: *unit_test_template
825   tags:
826     - ESP32_IDF
827     - UT_T1_1
828     - UT_single_core
829
830 UT_003_08:
831   <<: *unit_test_template
832   tags:
833     - ESP32_IDF
834     - UT_T1_1
835     - UT_single_core
836
837 UT_003_09:
838   <<: *unit_test_template
839   tags:
840     - ESP32_IDF
841     - UT_T1_1
842     - UT_single_core
843
844 UT_003_10:
845   <<: *unit_test_template
846   tags:
847     - ESP32_IDF
848     - UT_T1_1
849     - UT_single_core
850
851 UT_004_01:
852   <<: *unit_test_template
853   tags:
854     - ESP32_IDF
855     - UT_T1_1
856     - UT_psram
857
858 UT_004_02:
859   <<: *unit_test_template
860   tags:
861     - ESP32_IDF
862     - UT_T1_1
863     - UT_psram
864
865 UT_004_03:
866   <<: *unit_test_template
867   tags:
868     - ESP32_IDF
869     - UT_T1_1
870     - UT_psram
871
872 UT_004_04:
873   <<: *unit_test_template
874   tags:
875     - ESP32_IDF
876     - UT_T1_1
877     - UT_psram
878
879 UT_004_05:
880   <<: *unit_test_template
881   tags:
882     - ESP32_IDF
883     - UT_T1_SDMODE
884     - UT_psram
885
886 UT_004_06:
887   <<: *unit_test_template
888   tags:
889     - ESP32_IDF
890     - UT_T1_SPIMODE
891     - UT_psram
892
893 UT_004_07:
894   <<: *unit_test_template
895   tags:
896     - ESP32_IDF
897     - UT_T1_1
898     - UT_psram
899
900 UT_004_08:
901   <<: *unit_test_template
902   tags:
903     - ESP32_IDF
904     - UT_T1_1
905     - UT_psram
906
907 UT_004_09:
908   <<: *unit_test_template
909   tags:
910     - ESP32_IDF
911     - UT_T1_1
912     - UT_psram
913
914 UT_004_10:
915   <<: *unit_test_template
916   tags:
917     - ESP32_IDF
918     - UT_T1_1
919     - UT_psram
920
921 UT_004_11:
922   <<: *unit_test_template
923   tags:
924     - ESP32_IDF
925     - UT_T1_1
926     - UT_psram
927
928 IT_001_01:
929   <<: *test_template
930   tags:
931     - ESP32_IDF
932     - SSC_T1_1
933
934 IT_001_02:
935   <<: *test_template
936   tags:
937     - ESP32_IDF
938     - SSC_T1_1
939
940 IT_001_03:
941   <<: *test_template
942   tags:
943     - ESP32_IDF
944     - SSC_T1_1
945
946 IT_001_04:
947   <<: *test_template
948   tags:
949     - ESP32_IDF
950     - SSC_T1_1
951
952 IT_001_05:
953   <<: *test_template
954   tags:
955     - ESP32_IDF
956     - SSC_T1_1
957
958 IT_001_06:
959   <<: *test_template
960   tags:
961     - ESP32_IDF
962     - SSC_T1_1
963
964 IT_001_07:
965   <<: *test_template
966   tags:
967     - ESP32_IDF
968     - SSC_T1_1
969
970 IT_001_08:
971   <<: *test_template
972   tags:
973     - ESP32_IDF
974     - SSC_T1_1
975
976 IT_001_09:
977   <<: *test_template
978   tags:
979     - ESP32_IDF
980     - SSC_T1_1
981
982 IT_002_01:
983   <<: *test_template
984   tags:
985     - ESP32_IDF
986     - SSC_T1_2
987
988 IT_003_01:
989   <<: *test_template
990   tags:
991     - ESP32_IDF
992     - SSC_T2_1
993
994 IT_003_02:
995   <<: *test_template
996   tags:
997     - ESP32_IDF
998     - SSC_T2_1
999
1000 IT_003_03:
1001   <<: *test_template
1002   tags:
1003     - ESP32_IDF
1004     - SSC_T2_1
1005
1006 IT_003_04:
1007   <<: *test_template
1008   tags:
1009     - ESP32_IDF
1010     - SSC_T2_1
1011
1012 IT_003_05:
1013   <<: *test_template
1014   tags:
1015     - ESP32_IDF
1016     - SSC_T2_1
1017
1018 IT_003_06:
1019   <<: *test_template
1020   tags:
1021     - ESP32_IDF
1022     - SSC_T2_1
1023
1024 IT_003_07:
1025   <<: *test_template
1026   tags:
1027     - ESP32_IDF
1028     - SSC_T2_1
1029
1030 IT_003_08:
1031   <<: *test_template
1032   tags:
1033     - ESP32_IDF
1034     - SSC_T2_1
1035
1036 IT_003_09:
1037   <<: *test_template
1038   tags:
1039     - ESP32_IDF
1040     - SSC_T2_1
1041
1042 IT_003_10:
1043   <<: *test_template
1044   tags:
1045     - ESP32_IDF
1046     - SSC_T2_1
1047
1048 IT_003_11:
1049   <<: *test_template
1050   tags:
1051     - ESP32_IDF
1052     - SSC_T2_1
1053
1054 IT_003_12:
1055   <<: *test_template
1056   tags:
1057     - ESP32_IDF
1058     - SSC_T2_1
1059
1060 IT_003_13:
1061   <<: *test_template
1062   tags:
1063     - ESP32_IDF
1064     - SSC_T2_1
1065
1066 IT_003_14:
1067   <<: *test_template
1068   tags:
1069     - ESP32_IDF
1070     - SSC_T2_1
1071
1072 IT_004_01:
1073   <<: *test_template
1074   tags:
1075     - ESP32_IDF
1076     - SSC_T1_APC
1077
1078 IT_005_01:
1079   <<: *test_template
1080   tags:
1081     - ESP32_IDF
1082     - SSC_T1_WEP
1083
1084 IT_009_01:
1085   <<: *test_template
1086   tags:
1087     - ESP32_IDF
1088     - SSC_T1_3
1089
1090 IT_010_01:
1091   <<: *test_template
1092   tags:
1093     - ESP32_IDF
1094     - SSC_T5_1
1095
1096 IT_501_01:
1097   <<: *test_template
1098   tags:
1099     - ESP32_IDF
1100     - SSC_T1_1
1101     - stress_test
1102
1103 IT_501_02:
1104   <<: *test_template
1105   tags:
1106     - ESP32_IDF
1107     - SSC_T1_1
1108     - stress_test
1109
1110 IT_501_03:
1111   <<: *test_template
1112   tags:
1113     - ESP32_IDF
1114     - SSC_T1_1
1115     - stress_test
1116
1117 IT_502_01:
1118   <<: *test_template
1119   tags:
1120     - ESP32_IDF
1121     - SSC_T2_1
1122     - stress_test
1123
1124 IT_502_02:
1125   <<: *test_template
1126   tags:
1127     - ESP32_IDF
1128     - SSC_T2_1
1129     - stress_test
1130
1131 IT_503_01:
1132   <<: *test_template
1133   tags:
1134     - ESP32_IDF
1135     - SSC_T5_1
1136     - stress_test
1137
1138 IT_503_02:
1139   <<: *test_template
1140   tags:
1141     - ESP32_IDF
1142     - SSC_T5_1
1143     - stress_test
1144
1145 IT_503_03:
1146   <<: *test_template
1147   tags:
1148     - ESP32_IDF
1149     - SSC_T5_1
1150     - stress_test