13 # Common parameters for the 'make' during CI tests
14 MAKEFLAGS: "-j5 --no-keep-going"
16 # GitLab-CI environment
18 # more attempts for more robust
19 GET_SOURCES_ATTEMPTS: "10"
20 ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
22 # We use get_sources.sh script to fetch the submodules and/or re-fetch the repo
23 # if it was corrupted (if submodule update fails this can happen)
25 GIT_SUBMODULE_STRATEGY: none
27 UNIT_TEST_BUILD_SYSTEM: make
30 IDF_PATH: "$CI_PROJECT_DIR"
33 APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
34 CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
37 BOT_DOCKER_IMAGE_TAG: ":latest"
39 # When 'fetch' strategy is used, Gitlab removes untracked files before checking out
40 # new revision. However if the new revision doesn't include some of the submodules
41 # which were present in the old revision, such submodule directories would not be
42 # removed by the checkout. This extra step ensures that these stale submodules
44 .git_clean_stale_submodules: &git_clean_stale_submodules >
45 find . -name '.git' -not -path './.git' -printf '%P\n'
48 grep -q {} .gitmodules
49 || (echo "Removing {}, has .git directory but not in .gitmodules file"
52 # before each job, we need to check if this job is filtered by bot stage/job filter
53 .apply_bot_filter: &apply_bot_filter
54 python $APPLY_BOT_FILTER_SCRIPT || exit 0
57 - source tools/ci/setup_python.sh
58 - *git_clean_stale_submodules
59 # apply bot filter in before script
64 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
65 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
66 - chmod 600 ~/.ssh/id_rsa
67 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
69 # Set IS_PRIVATE or IS_PUBLIC depending on if our branch is public or not
71 # (the same regular expressions are used to set these are used in 'only:' sections below
72 - source tools/ci/configure_ci_environment.sh
74 # fetch the submodules (& if necessary re-fetch repo) from gitlab
75 - time ./tools/ci/get-full-sources.sh
77 # used for check scripts which we want to run unconditionally
78 .do_nothing_before_no_filter:
79 before_script: &do_nothing_before_no_filter
80 - source tools/ci/setup_python.sh
81 - *git_clean_stale_submodules
83 # used for everything else where we want to do no prep, except for bot filter
85 before_script: &do_nothing_before
86 - source tools/ci/setup_python.sh
87 - *git_clean_stale_submodules
88 # apply bot filter in before script
90 - echo "Not setting up GitLab key, not fetching submodules"
91 - source tools/ci/configure_ci_environment.sh
93 .add_gitlab_key_before:
94 before_script: &add_gitlab_key_before
95 - source tools/ci/setup_python.sh
96 - *git_clean_stale_submodules
97 # apply bot filter in before script
99 - echo "Not fetching submodules"
100 - source tools/ci/configure_ci_environment.sh
104 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
105 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
106 - chmod 600 ~/.ssh/id_rsa
107 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
111 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
119 - $BOT_TRIGGER_WITH_LABEL == null
121 - $BOT_LABEL_REGULAR_TEST
123 # Set the variable for 'esp-idf-template' testing
124 - ESP_IDF_TEMPLATE_GIT=${ESP_IDF_TEMPLATE_GIT:-"https://github.com/espressif/esp-idf-template.git"}
125 - git clone ${ESP_IDF_TEMPLATE_GIT}
126 - cd esp-idf-template
127 # Try to use the same branch name for esp-idf-template that we're
128 # using on esp-idf. If it doesn't exist then just stick to the default
130 - python $CHECKOUT_REF_SCRIPT esp-idf-template
132 # Test debug build (default)
134 # Now test release build
136 - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
138 # Check if there are any stray printf/ets_printf references in WiFi libs
139 - cd ../components/esp32/lib
140 - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
141 - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
144 .build_template: &build_template
146 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
153 .build_ssc_template: &build_ssc_template
160 SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF"
163 - $BOT_TRIGGER_WITH_LABEL == null
165 - $BOT_LABEL_INTEGRATION_TEST
166 - $BOT_LABEL_REGULAR_TEST
168 - git clone $SSC_REPOSITORY
170 - python $CHECKOUT_REF_SCRIPT SSC
171 - MAKEFLAGS= ./ci_build_ssc.sh "${CI_JOB_NAME}" "${IDF_PATH}/.gitlab-ci.yml"
173 # don't forget to add to dependency to test_template when adding new build_ssc jobs
175 <<: *build_ssc_template
178 <<: *build_ssc_template
181 <<: *build_ssc_template
183 # If you want to add new build ssc jobs, please add it into dependencies of `assign_test` and `.test_template`
186 .build_esp_idf_unit_test_template: &build_esp_idf_unit_test_template
190 - tools/unit-test-app/output
191 - components/idf_test/unit_test/TestCaseAll.yml
195 - $BOT_TRIGGER_WITH_LABEL == null
197 - $BOT_LABEL_UNIT_TEST
198 - $BOT_LABEL_REGULAR_TEST
200 build_esp_idf_tests_make:
201 <<: *build_esp_idf_unit_test_template
203 - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
204 - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
205 - cd $CI_PROJECT_DIR/tools/unit-test-app
206 - MAKEFLAGS= make help # make sure kconfig tools are built in single process
207 - make ut-clean-all-configs
208 - make ut-build-all-configs
209 - python tools/UnitTestParser.py
210 # Check if the tests demand Make built binaries. If not, delete them
211 - if [ "$UNIT_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
212 - rm -rf builds output sdkconfig
213 - rm -rf components/idf_test/unit_test/TestCaseAll.yml
214 - rm -rf components/idf_test/unit_test/CIConfigs/*.yml
216 build_esp_idf_tests_cmake:
217 <<: *build_esp_idf_unit_test_template
219 - export PATH="$IDF_PATH/tools:$PATH"
220 - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
221 - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
222 - cd $CI_PROJECT_DIR/tools/unit-test-app
223 - idf.py ut-clean-all-configs
224 - idf.py ut-build-all-configs
225 - python tools/UnitTestParser.py
226 # Check if the tests demand CMake built binaries. If not, delete them
227 - if [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
228 - rm -rf builds output sdkconfig
229 - rm -rf components/idf_test/unit_test/TestCaseAll.yml
230 - rm -rf components/idf_test/unit_test/CIConfigs/*.yml
232 .build_examples_make_template: &build_examples_make_template
234 # This is a workaround for a rarely encountered issue with building examples in CI.
235 # Probably related to building of Kconfig in 'make clean' stage
240 - build_examples/*/*/*/build/*.bin
241 - build_examples/*/*/*/build/*.elf
242 - build_examples/*/*/*/build/*.map
243 - build_examples/*/*/*/build/download.config
244 - build_examples/*/*/*/build/bootloader/*.bin
249 LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
252 - $BOT_TRIGGER_WITH_LABEL == null
254 - $BOT_LABEL_EXAMPLE_TEST
255 - $BOT_LABEL_REGULAR_TEST
257 # it's not possible to build 100% out-of-tree and have the "artifacts"
258 # mechanism work, but this is the next best thing
259 - rm -rf build_examples
260 - mkdir build_examples
262 # build some of examples
263 - mkdir -p ${LOG_PATH}
264 - ${IDF_PATH}/tools/ci/build_examples.sh "${CI_JOB_NAME}"
266 # same as above, but for CMake
267 .build_examples_cmake_template: &build_examples_cmake_template
272 - build_examples_cmake/*/*/*/build/*.bin
273 - build_examples_cmake/*/*/*/build/*.elf
274 - build_examples_cmake/*/*/*/build/*.map
275 - build_examples_cmake/*/*/*/build/download.config
276 - build_examples_cmake/*/*/*/build/bootloader/*.bin
281 LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
284 - $BOT_TRIGGER_WITH_LABEL == null
286 - $BOT_LABEL_EXAMPLE_TEST
287 - $BOT_LABEL_REGULAR_TEST
289 # it's not possible to build 100% out-of-tree and have the "artifacts"
290 # mechanism work, but this is the next best thing
291 - rm -rf build_examples_cmake
292 - mkdir build_examples_cmake
293 - cd build_examples_cmake
294 # build some of examples
295 - mkdir -p ${LOG_PATH}
296 - ${IDF_PATH}/tools/ci/build_examples_cmake.sh "${CI_JOB_NAME}"
298 build_examples_make_00:
299 <<: *build_examples_make_template
301 build_examples_make_01:
302 <<: *build_examples_make_template
304 build_examples_make_02:
305 <<: *build_examples_make_template
307 build_examples_make_03:
308 <<: *build_examples_make_template
310 build_examples_make_04:
311 <<: *build_examples_make_template
313 build_examples_make_05:
314 <<: *build_examples_make_template
316 build_examples_make_06:
317 <<: *build_examples_make_template
319 build_examples_make_07:
320 <<: *build_examples_make_template
322 build_examples_cmake_00:
323 <<: *build_examples_cmake_template
325 build_examples_cmake_01:
326 <<: *build_examples_cmake_template
328 build_examples_cmake_02:
329 <<: *build_examples_cmake_template
331 build_examples_cmake_03:
332 <<: *build_examples_cmake_template
334 build_examples_cmake_04:
335 <<: *build_examples_cmake_template
337 build_examples_cmake_05:
338 <<: *build_examples_cmake_template
340 build_examples_cmake_06:
341 <<: *build_examples_cmake_template
343 build_examples_cmake_07:
344 <<: *build_examples_cmake_template
346 # If you want to add new build example jobs, please add it into dependencies of `.example_test_template`
350 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
356 # English version of documentation
357 - docs/en/doxygen-warning-log.txt
358 - docs/en/sphinx-warning-log.txt
359 - docs/en/sphinx-warning-log-sanitized.txt
360 - docs/en/_build/html
362 # Chinese version of documentation
363 - docs/zh_CN/doxygen-warning-log.txt
364 - docs/zh_CN/sphinx-warning-log.txt
365 - docs/zh_CN/sphinx-warning-log-sanitized.txt
366 - docs/zh_CN/_build/html
370 - $BOT_TRIGGER_WITH_LABEL == null
372 - $BOT_LABEL_BUILD_DOCS
373 - $BOT_LABEL_REGULAR_TEST
376 - ./check_lang_folder_sync.sh
380 - ../check_doc_warnings.sh
384 - ../check_doc_warnings.sh
386 .check_job_template: &check_job_template
388 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
392 before_script: *do_nothing_before_no_filter
395 <<: *check_job_template
399 - $BOT_TRIGGER_WITH_LABEL == null
401 - $BOT_LABEL_REGULAR_TEST
403 tools/cmake/run_cmake_lint.sh
405 .host_test_template: &host_test_template
407 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
413 - $BOT_TRIGGER_WITH_LABEL == null
414 - $BOT_LABEL_HOST_TEST
415 - $BOT_LABEL_REGULAR_TEST
418 <<: *host_test_template
420 - cd components/nvs_flash/test_nvs_host
424 <<: *host_test_template
427 - components/nvs_flash/test_nvs_host/coverage_report
433 - $BOT_LABEL_NVS_COVERAGE
435 - cd components/nvs_flash/test_nvs_host
436 - make coverage_report
438 test_partition_table_on_host:
439 <<: *host_test_template
443 - cd components/partition_table/test_gen_esp32part_host
444 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./gen_esp32part_tests.py
447 <<: *host_test_template
450 - components/wear_levelling/test_wl_host/coverage_report.zip
453 - cd components/wear_levelling/test_wl_host
457 <<: *host_test_template
459 - cd components/fatfs/test_fatfs_host/
463 <<: *host_test_template
465 - cd tools/ldgen/test
466 - ./test_fragments.py
467 - ./test_generation.py
469 .host_fuzzer_test_template: &host_fuzzer_test_template
471 image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
478 - ${FUZZER_TEST_DIR}/out/crashes
479 - ${FUZZER_TEST_DIR}/fuzz_output.log
483 # can only be triggered
486 - $BOT_LABEL_FUZZER_TEST
488 - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
489 - cd ${FUZZER_TEST_DIR}
490 # run AFL fuzzer for one hour
491 - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
492 - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
493 # check no crashes found
494 - test -z "$(ls out/crashes/)" || exit 1
496 test_mdns_fuzzer_on_host:
497 <<: *host_fuzzer_test_template
499 BOT_NEEDS_TRIGGER_BY_NAME: 1
500 FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
502 test_lwip_dns_fuzzer_on_host:
503 <<: *host_fuzzer_test_template
505 BOT_NEEDS_TRIGGER_BY_NAME: 1
506 FUZZER_TEST_DIR: components/lwip/test_afl_host
507 FUZZER_PARAMS: MODE=dns
509 test_lwip_dhcp_fuzzer_on_host:
510 <<: *host_fuzzer_test_template
512 BOT_NEEDS_TRIGGER_BY_NAME: 1
513 FUZZER_TEST_DIR: components/lwip/test_afl_host
514 FUZZER_PARAMS: MODE=dhcp_client
516 test_lwip_dhcps_fuzzer_on_host:
517 <<: *host_fuzzer_test_template
519 BOT_NEEDS_TRIGGER_BY_NAME: 1
520 FUZZER_TEST_DIR: components/lwip/test_afl_host
521 FUZZER_PARAMS: MODE=dhcp_server
524 <<: *host_test_template
526 - cd components/spiffs/test_spiffs_host/
529 test_multi_heap_on_host:
530 <<: *host_test_template
532 - cd components/heap/test_multi_heap_host
533 - ./test_all_configs.sh
536 <<: *host_test_template
538 - cd tools/kconfig_new/test
539 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
542 <<: *host_test_template
544 - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
545 - rm -rf test_build_system
546 - mkdir test_build_system
547 - cd test_build_system
548 - ${IDF_PATH}/tools/ci/test_build_system.sh
550 test_build_system_cmake:
551 <<: *host_test_template
553 - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
554 - rm -rf test_build_system
555 - mkdir test_build_system
556 - cd test_build_system
557 - ${IDF_PATH}/tools/ci/test_build_system_cmake.sh
560 <<: *host_test_template
564 - tools/test_idf_monitor/outputs/*
567 - cd ${IDF_PATH}/tools/test_idf_monitor
568 - ./run_test_idf_monitor.py
571 <<: *host_test_template
575 - tools/test_idf_size/output
576 - tools/test_idf_size/.coverage
579 - cd ${IDF_PATH}/tools/test_idf_size
580 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
582 test_esp_err_to_name_on_host:
583 <<: *host_test_template
587 - components/esp32/esp_err_to_name.c
590 - cd ${IDF_PATH}/tools/
591 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
592 - 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; }
593 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
594 - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
597 <<: *host_test_template
601 - components/espcoredump/test/.coverage
602 - components/espcoredump/test/output
605 - cd components/espcoredump/test/
606 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
610 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
616 - /^v\d+\.\d+(\.\d+)?($|-)/
619 before_script: *do_nothing_before
623 - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
624 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
625 - chmod 600 ~/.ssh/id_rsa
626 - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
627 - git remote remove github &>/dev/null || true
628 - git remote add github git@github.com:espressif/esp-idf.git
629 - tools/ci/push_to_github.sh
633 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
640 - /^v\d+\.\d+(\.\d+)?($|-)/
643 - $BOT_TRIGGER_WITH_LABEL == null
644 - $BOT_LABEL_BUILD_DOCS
647 before_script: *do_nothing_before
651 - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
652 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
653 - chmod 600 ~/.ssh/id_rsa
654 - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
655 - export GIT_VER=$(git describe --always)
658 - tar czvf $GIT_VER.tar.gz $GIT_VER
659 - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
660 - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
661 - cd ../../zh_CN/_build/
663 - tar czvf $GIT_VER.tar.gz $GIT_VER
664 - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
665 - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
666 # add link to preview doc
667 - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
668 - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
672 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
677 # can only be triggered
680 - $BOT_TRIGGER_WITH_LABEL == null
681 - $BOT_LABEL_BUILD_DOCS
684 - docs/_build/linkcheck
687 # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
688 - test "$CHECK_LINKS" = "Yes" || exit 0
689 # can only run on master branch (otherwise the commit is not on Github yet)
690 - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
695 <<: *check_job_template
697 - tools/ci/check-line-endings.sh ${IDF_PATH}
700 <<: *check_job_template
703 - git log -n10 --oneline
704 # commit start with "WIP: " need to be squashed before merge
705 - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
708 <<: *check_job_template
710 - tools/ci/check-executable.sh
712 check_examples_cmake_make:
713 <<: *check_job_template
717 - /^v\d+\.\d+(\.\d+)?($|-)/
718 before_script: *do_nothing_before
720 - tools/ci/check_examples_cmake_make.sh
723 <<: *check_job_template
729 before_script: *do_nothing_before
731 # run it only under Python 3 (it is very slow under Python 2)
732 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH
736 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
742 - /^v\d+\.\d+(\.\d+)?($|-)/
744 before_script: *do_nothing_before
746 - tools/ci/check_ut_cmake_make.sh
748 check_submodule_sync:
749 <<: *check_job_template
753 # check if all submodules are correctly synced to public repostory
754 - git submodule update --init --recursive
756 check_artifacts_expire_time:
757 <<: *check_job_template
759 # check if we have set expire time for all artifacts
760 - python tools/ci/check_artifacts_expire_time.py
762 check_pipeline_triggered_by_label:
763 <<: *check_job_template
767 - $BOT_TRIGGER_WITH_LABEL
769 # If the pipeline is triggered with label, the pipeline will only succeeded if "regular_test" label is added.
770 # We want to make sure some jobs are always executed to detect regression.
771 - test "$BOT_LABEL_REGULAR_TEST" = "true" || exit -1
776 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
778 # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
779 # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
784 - build_esp_idf_tests_make
785 - build_esp_idf_tests_cmake
787 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
788 EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
791 - components/idf_test/*/CIConfigs
792 - components/idf_test/*/TC.sqlite
793 - $EXAMPLE_CONFIG_OUTPUT_PATH
797 - $BOT_TRIGGER_WITH_LABEL == null
798 - $BOT_LABEL_UNIT_TEST
799 - $BOT_LABEL_INTEGRATION_TEST
800 - $BOT_LABEL_EXAMPLE_TEST
801 before_script: *add_gitlab_key_before
803 # assign example tests
804 - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
805 # assign unit test cases
806 - 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
807 # clone test script to assign tests
808 - git clone $TEST_SCRIPT_REPOSITORY
809 - cd auto_test_script
810 - python $CHECKOUT_REF_SCRIPT auto_test_script
811 # assgin integration test cases
812 - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
814 .example_test_template: &example_test_template
821 - /^v\d+\.\d+(\.\d+)?($|-)/
825 - $BOT_TRIGGER_WITH_LABEL == null
826 - $BOT_LABEL_EXAMPLE_TEST
829 - build_examples_make_00
830 - build_examples_make_01
831 - build_examples_make_02
832 - build_examples_make_03
833 - build_examples_make_04
834 - build_examples_make_05
835 - build_examples_make_06
836 - build_examples_make_07
837 - build_examples_cmake_00
838 - build_examples_cmake_01
839 - build_examples_cmake_02
840 - build_examples_cmake_03
841 - build_examples_cmake_04
842 - build_examples_cmake_05
843 - build_examples_cmake_06
844 - build_examples_cmake_07
851 junit: $LOG_PATH/*/XUNIT_RESULT.xml
853 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
854 TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
855 CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
856 LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
857 ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
859 # first test if config file exists, if not exist, exit 0
860 - test -e $CONFIG_FILE || exit 0
861 # clone test env configs
862 - git clone $TEST_ENV_CONFIG_REPOSITORY
863 - cd ci-test-runner-configs
864 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
867 - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
869 .unit_test_template: &unit_test_template
870 <<: *example_test_template
874 - build_esp_idf_tests_make
875 - build_esp_idf_tests_cmake
880 - /^v\d+\.\d+(\.\d+)?($|-)/
884 - $BOT_TRIGGER_WITH_LABEL == null
885 - $BOT_LABEL_UNIT_TEST
887 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
888 TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
889 CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
890 LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
891 ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
893 .test_template: &test_template
900 - /^v\d+\.\d+(\.\d+)?($|-)/
904 - $BOT_TRIGGER_WITH_LABEL == null
905 - $BOT_LABEL_INTEGRATION_TEST
917 LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
918 LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
919 TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
920 MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
921 CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
922 before_script: *add_gitlab_key_before
924 # first test if config file exists, if not exist, exit 0
925 - test -e $CONFIG_FILE || exit 0
926 # clone local test env configs
927 - git clone $TEST_ENV_CONFIG_REPOSITORY
928 - cd ci-test-runner-configs
929 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
931 - git clone $TEST_SCRIPT_REPOSITORY
932 - cd auto_test_script
933 - python $CHECKOUT_REF_SCRIPT auto_test_script
935 - 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
949 # clone local test env configs
950 - git clone $TEST_ENV_CONFIG_REPOSITORY
951 - cd ci-test-runner-configs
952 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
954 - git clone $TEST_SCRIPT_REPOSITORY
955 - cd auto_test_script
956 - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
958 - ./Tools/prepare_nvs_bin.sh
960 - 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
963 <<: *example_test_template
969 <<: *example_test_template
975 <<: *example_test_template
976 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
979 - Example_ShieldBox_Basic
982 <<: *example_test_template
988 <<: *example_test_template
994 <<: *example_test_template
1000 <<: *example_test_template
1001 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
1004 - $BOT_LABEL_IPERF_STRESS_TEST
1009 example_test_007_01:
1010 <<: *example_test_template
1013 - Example_I2C_CCS811_SENSOR
1016 <<: *unit_test_template
1022 <<: *unit_test_template
1028 <<: *unit_test_template
1034 <<: *unit_test_template
1040 <<: *unit_test_template
1046 <<: *unit_test_template
1052 <<: *unit_test_template
1058 <<: *unit_test_template
1064 <<: *unit_test_template
1070 <<: *unit_test_template
1076 <<: *unit_test_template
1082 <<: *unit_test_template
1088 <<: *unit_test_template
1094 <<: *unit_test_template
1100 <<: *unit_test_template
1106 <<: *unit_test_template
1112 <<: *unit_test_template
1118 <<: *unit_test_template
1124 <<: *unit_test_template
1130 <<: *unit_test_template
1136 <<: *unit_test_template
1142 <<: *unit_test_template
1148 <<: *unit_test_template
1154 <<: *unit_test_template
1160 <<: *unit_test_template
1166 <<: *unit_test_template
1172 <<: *unit_test_template
1178 <<: *unit_test_template
1184 <<: *unit_test_template
1190 <<: *unit_test_template
1196 <<: *unit_test_template
1202 <<: *unit_test_template
1208 <<: *unit_test_template
1214 <<: *unit_test_template
1220 <<: *unit_test_template
1226 <<: *unit_test_template
1232 <<: *unit_test_template
1238 <<: *unit_test_template
1244 <<: *unit_test_template
1250 <<: *unit_test_template
1256 <<: *unit_test_template
1262 <<: *unit_test_template
1268 <<: *unit_test_template
1274 <<: *unit_test_template
1280 <<: *unit_test_template
1286 <<: *unit_test_template
1292 <<: *unit_test_template
1298 <<: *unit_test_template
1304 <<: *unit_test_template
1311 <<: *unit_test_template
1318 <<: *unit_test_template
1325 <<: *unit_test_template
1332 <<: *unit_test_template
1339 <<: *unit_test_template
1346 <<: *unit_test_template
1353 <<: *unit_test_template
1360 <<: *unit_test_template
1367 <<: *unit_test_template
1374 <<: *unit_test_template
1381 <<: *unit_test_template
1388 <<: *unit_test_template
1395 <<: *unit_test_template
1402 <<: *unit_test_template
1409 <<: *unit_test_template
1416 <<: *unit_test_template
1423 <<: *unit_test_template
1430 <<: *unit_test_template
1437 <<: *unit_test_template
1443 <<: *unit_test_template
1449 <<: *unit_test_template
1455 <<: *unit_test_template
1462 <<: *unit_test_template
1468 <<: *unit_test_template
1474 <<: *unit_test_template
1480 <<: *unit_test_template
1487 <<: *unit_test_template
1493 <<: *unit_test_template
1499 <<: *unit_test_template
1505 <<: *unit_test_template
1512 <<: *unit_test_template
1518 <<: *unit_test_template
1524 <<: *unit_test_template
1530 <<: *unit_test_template
1537 <<: *unit_test_template
1543 <<: *unit_test_template
1549 <<: *unit_test_template
1555 <<: *unit_test_template
1562 <<: *unit_test_template
1568 <<: *unit_test_template
1574 <<: *unit_test_template
1580 <<: *unit_test_template
1587 <<: *unit_test_template
1594 <<: *unit_test_template
1601 <<: *unit_test_template
1608 <<: *unit_test_template
1615 <<: *unit_test_template
1621 <<: *unit_test_template
1627 <<: *unit_test_template
1633 <<: *unit_test_template
1640 <<: *unit_test_template
1646 <<: *unit_test_template
1652 <<: *unit_test_template
1658 <<: *unit_test_template
1665 <<: *unit_test_template
1671 <<: *unit_test_template
1677 <<: *unit_test_template
1683 <<: *unit_test_template
1690 <<: *unit_test_template