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="-Werror -Werror=deprecated-declarations"
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 - if [ "$UNIT_TEST_BUILD_SYSTEM" == "make" ]; then exit 0; fi
211 # If Make, delete the CMake built artifacts
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="-Werror -Werror=deprecated-declarations"
221 - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
222 - cd $CI_PROJECT_DIR/tools/unit-test-app
223 # Build with CMake first
224 - idf.py ut-clean-all-configs
225 - idf.py ut-build-all-configs
226 - python tools/UnitTestParser.py
227 # Check if test demands CMake or Make built binaries. If CMake leave the built artifacts as is then exit.
228 - if [ "$UNIT_TEST_BUILD_SYSTEM" == "cmake" ]; then exit 0; fi
229 # If Make, delete the CMake built artifacts
230 - rm -rf builds output sdkconfig
231 - rm -rf components/idf_test/unit_test/TestCaseAll.yml
232 - rm -rf components/idf_test/unit_test/CIConfigs/*.yml
234 .build_examples_make_template: &build_examples_make_template
236 # This is a workaround for a rarely encountered issue with building examples in CI.
237 # Probably related to building of Kconfig in 'make clean' stage
242 - build_examples/*/*/*/build/*.bin
243 - build_examples/*/*/*/build/*.elf
244 - build_examples/*/*/*/build/*.map
245 - build_examples/*/*/*/build/download.config
246 - build_examples/*/*/*/build/bootloader/*.bin
251 LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
254 - $BOT_TRIGGER_WITH_LABEL == null
256 - $BOT_LABEL_EXAMPLE_TEST
257 - $BOT_LABEL_REGULAR_TEST
259 # it's not possible to build 100% out-of-tree and have the "artifacts"
260 # mechanism work, but this is the next best thing
261 - rm -rf build_examples
262 - mkdir build_examples
264 # build some of examples
265 - mkdir -p ${LOG_PATH}
266 - ${IDF_PATH}/tools/ci/build_examples.sh "${CI_JOB_NAME}"
268 # same as above, but for CMake
269 .build_examples_cmake_template: &build_examples_cmake_template
274 - build_examples_cmake/*/*/*/build/*.bin
275 - build_examples_cmake/*/*/*/build/*.elf
276 - build_examples_cmake/*/*/*/build/*.map
277 - build_examples_cmake/*/*/*/build/download.config
278 - build_examples_cmake/*/*/*/build/bootloader/*.bin
283 LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
286 - $BOT_TRIGGER_WITH_LABEL == null
288 - $BOT_LABEL_EXAMPLE_TEST
289 - $BOT_LABEL_REGULAR_TEST
291 # it's not possible to build 100% out-of-tree and have the "artifacts"
292 # mechanism work, but this is the next best thing
293 - rm -rf build_examples_cmake
294 - mkdir build_examples_cmake
295 - cd build_examples_cmake
296 # build some of examples
297 - mkdir -p ${LOG_PATH}
298 - ${IDF_PATH}/tools/ci/build_examples_cmake.sh "${CI_JOB_NAME}"
300 build_examples_make_00:
301 <<: *build_examples_make_template
303 build_examples_make_01:
304 <<: *build_examples_make_template
306 build_examples_make_02:
307 <<: *build_examples_make_template
309 build_examples_make_03:
310 <<: *build_examples_make_template
312 build_examples_make_04:
313 <<: *build_examples_make_template
315 build_examples_make_05:
316 <<: *build_examples_make_template
318 build_examples_make_06:
319 <<: *build_examples_make_template
321 build_examples_make_07:
322 <<: *build_examples_make_template
324 build_examples_cmake_00:
325 <<: *build_examples_cmake_template
327 build_examples_cmake_01:
328 <<: *build_examples_cmake_template
330 build_examples_cmake_02:
331 <<: *build_examples_cmake_template
333 build_examples_cmake_03:
334 <<: *build_examples_cmake_template
336 build_examples_cmake_04:
337 <<: *build_examples_cmake_template
339 build_examples_cmake_05:
340 <<: *build_examples_cmake_template
342 build_examples_cmake_06:
343 <<: *build_examples_cmake_template
345 build_examples_cmake_07:
346 <<: *build_examples_cmake_template
348 # If you want to add new build example jobs, please add it into dependencies of `.example_test_template`
352 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
358 # English version of documentation
359 - docs/en/doxygen-warning-log.txt
360 - docs/en/sphinx-warning-log.txt
361 - docs/en/sphinx-warning-log-sanitized.txt
362 - docs/en/_build/html
364 # Chinese version of documentation
365 - docs/zh_CN/doxygen-warning-log.txt
366 - docs/zh_CN/sphinx-warning-log.txt
367 - docs/zh_CN/sphinx-warning-log-sanitized.txt
368 - docs/zh_CN/_build/html
372 - $BOT_TRIGGER_WITH_LABEL == null
374 - $BOT_LABEL_BUILD_DOCS
375 - $BOT_LABEL_REGULAR_TEST
378 - ./check_lang_folder_sync.sh
382 - ../check_doc_warnings.sh
386 - ../check_doc_warnings.sh
388 .check_job_template: &check_job_template
390 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
394 before_script: *do_nothing_before_no_filter
397 <<: *check_job_template
401 - $BOT_TRIGGER_WITH_LABEL == null
403 - $BOT_LABEL_REGULAR_TEST
405 tools/cmake/run_cmake_lint.sh
407 .host_test_template: &host_test_template
409 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
415 - $BOT_TRIGGER_WITH_LABEL == null
416 - $BOT_LABEL_HOST_TEST
417 - $BOT_LABEL_REGULAR_TEST
420 <<: *host_test_template
422 - cd components/nvs_flash/test_nvs_host
426 <<: *host_test_template
429 - components/nvs_flash/test_nvs_host/coverage_report
435 - $BOT_LABEL_NVS_COVERAGE
437 - cd components/nvs_flash/test_nvs_host
438 - make coverage_report
440 test_partition_table_on_host:
441 <<: *host_test_template
445 - cd components/partition_table/test_gen_esp32part_host
446 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./gen_esp32part_tests.py
449 <<: *host_test_template
452 - components/wear_levelling/test_wl_host/coverage_report.zip
455 - cd components/wear_levelling/test_wl_host
459 <<: *host_test_template
461 - cd components/fatfs/test_fatfs_host/
465 <<: *host_test_template
467 - cd tools/ldgen/test
468 - ./test_fragments.py
469 - ./test_generation.py
471 .host_fuzzer_test_template: &host_fuzzer_test_template
473 image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
480 - ${FUZZER_TEST_DIR}/out/crashes
481 - ${FUZZER_TEST_DIR}/fuzz_output.log
485 # can only be triggered
488 - $BOT_LABEL_FUZZER_TEST
490 - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
491 - cd ${FUZZER_TEST_DIR}
492 # run AFL fuzzer for one hour
493 - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
494 - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
495 # check no crashes found
496 - test -z "$(ls out/crashes/)" || exit 1
498 test_mdns_fuzzer_on_host:
499 <<: *host_fuzzer_test_template
501 BOT_NEEDS_TRIGGER_BY_NAME: 1
502 FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
504 test_lwip_dns_fuzzer_on_host:
505 <<: *host_fuzzer_test_template
507 BOT_NEEDS_TRIGGER_BY_NAME: 1
508 FUZZER_TEST_DIR: components/lwip/test_afl_host
509 FUZZER_PARAMS: MODE=dns
511 test_lwip_dhcp_fuzzer_on_host:
512 <<: *host_fuzzer_test_template
514 BOT_NEEDS_TRIGGER_BY_NAME: 1
515 FUZZER_TEST_DIR: components/lwip/test_afl_host
516 FUZZER_PARAMS: MODE=dhcp_client
518 test_lwip_dhcps_fuzzer_on_host:
519 <<: *host_fuzzer_test_template
521 BOT_NEEDS_TRIGGER_BY_NAME: 1
522 FUZZER_TEST_DIR: components/lwip/test_afl_host
523 FUZZER_PARAMS: MODE=dhcp_server
526 <<: *host_test_template
528 - cd components/spiffs/test_spiffs_host/
531 test_multi_heap_on_host:
532 <<: *host_test_template
534 - cd components/heap/test_multi_heap_host
535 - ./test_all_configs.sh
538 <<: *host_test_template
540 - cd tools/kconfig_new/test
541 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
544 <<: *host_test_template
546 - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
547 - rm -rf test_build_system
548 - mkdir test_build_system
549 - cd test_build_system
550 - ${IDF_PATH}/tools/ci/test_build_system.sh
552 test_build_system_cmake:
553 <<: *host_test_template
555 - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
556 - rm -rf test_build_system
557 - mkdir test_build_system
558 - cd test_build_system
559 - ${IDF_PATH}/tools/ci/test_build_system_cmake.sh
562 <<: *host_test_template
566 - tools/test_idf_monitor/outputs/*
569 - cd ${IDF_PATH}/tools/test_idf_monitor
570 - ./run_test_idf_monitor.py
573 <<: *host_test_template
577 - tools/test_idf_size/output
578 - tools/test_idf_size/.coverage
581 - cd ${IDF_PATH}/tools/test_idf_size
582 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
584 test_esp_err_to_name_on_host:
585 <<: *host_test_template
589 - components/esp32/esp_err_to_name.c
592 - cd ${IDF_PATH}/tools/
593 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
594 - 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; }
595 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
596 - git diff --exit-code -- ../components/esp32/esp_err_to_name.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
599 <<: *host_test_template
603 - components/espcoredump/test/.coverage
604 - components/espcoredump/test/output
607 - cd components/espcoredump/test/
608 - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
612 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
618 - /^v\d+\.\d+(\.\d+)?($|-)/
621 before_script: *do_nothing_before
625 - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
626 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
627 - chmod 600 ~/.ssh/id_rsa
628 - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
629 - git remote remove github &>/dev/null || true
630 - git remote add github git@github.com:espressif/esp-idf.git
631 - tools/ci/push_to_github.sh
635 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
642 - /^v\d+\.\d+(\.\d+)?($|-)/
645 - $BOT_TRIGGER_WITH_LABEL == null
646 - $BOT_LABEL_BUILD_DOCS
649 before_script: *do_nothing_before
653 - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
654 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
655 - chmod 600 ~/.ssh/id_rsa
656 - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
657 - export GIT_VER=$(git describe --always)
660 - tar czvf $GIT_VER.tar.gz $GIT_VER
661 - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/en
662 - ssh $DOCS_SERVER -x "cd $DOCS_PATH/en && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
663 - cd ../../zh_CN/_build/
665 - tar czvf $GIT_VER.tar.gz $GIT_VER
666 - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH/zh_CN
667 - ssh $DOCS_SERVER -x "cd $DOCS_PATH/zh_CN && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
668 # add link to preview doc
669 - echo "[document preview][en] $CI_DOCKER_REGISTRY/docs/esp-idf/en/${GIT_VER}/index.html"
670 - echo "[document preview][zh_CN] $CI_DOCKER_REGISTRY/docs/esp-idf/zh_CN/${GIT_VER}/index.html"
674 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
679 # can only be triggered
682 - $BOT_TRIGGER_WITH_LABEL == null
683 - $BOT_LABEL_BUILD_DOCS
686 - docs/_build/linkcheck
689 # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
690 - test "$CHECK_LINKS" = "Yes" || exit 0
691 # can only run on master branch (otherwise the commit is not on Github yet)
692 - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
697 <<: *check_job_template
699 - tools/ci/check-line-endings.sh ${IDF_PATH}
702 <<: *check_job_template
705 - git log -n10 --oneline
706 # commit start with "WIP: " need to be squashed before merge
707 - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
710 <<: *check_job_template
712 - tools/ci/check-executable.sh
714 check_examples_cmake_make:
715 <<: *check_job_template
719 - /^v\d+\.\d+(\.\d+)?($|-)/
720 before_script: *do_nothing_before
722 - tools/ci/check_examples_cmake_make.sh
725 <<: *check_job_template
731 before_script: *do_nothing_before
733 # run it only under Python 3 (it is very slow under Python 2)
734 - ${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
738 image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
744 - /^v\d+\.\d+(\.\d+)?($|-)/
746 before_script: *do_nothing_before
748 - tools/ci/check_ut_cmake_make.sh
750 check_submodule_sync:
751 <<: *check_job_template
755 # check if all submodules are correctly synced to public repostory
756 - git submodule update --init --recursive
758 check_artifacts_expire_time:
759 <<: *check_job_template
761 # check if we have set expire time for all artifacts
762 - python tools/ci/check_artifacts_expire_time.py
764 check_pipeline_triggered_by_label:
765 <<: *check_job_template
769 - $BOT_TRIGGER_WITH_LABEL
771 # If the pipeline is triggered with label, the pipeline will only succeeded if "regular_test" label is added.
772 # We want to make sure some jobs are always executed to detect regression.
773 - test "$BOT_LABEL_REGULAR_TEST" = "true" || exit -1
778 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
780 # gitlab ci do not support match job with RegEx or wildcard now in dependencies.
781 # we have a lot build example jobs. now we don't use dependencies, just download all artificats of build stage.
786 - build_esp_idf_tests_make
787 - build_esp_idf_tests_cmake
789 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
790 EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
793 - components/idf_test/*/CIConfigs
794 - components/idf_test/*/TC.sqlite
795 - $EXAMPLE_CONFIG_OUTPUT_PATH
799 - $BOT_TRIGGER_WITH_LABEL == null
800 - $BOT_LABEL_UNIT_TEST
801 - $BOT_LABEL_INTEGRATION_TEST
802 - $BOT_LABEL_EXAMPLE_TEST
803 before_script: *add_gitlab_key_before
805 # assign example tests
806 - python $TEST_FW_PATH/CIAssignExampleTest.py $IDF_PATH/examples $IDF_PATH/.gitlab-ci.yml $EXAMPLE_CONFIG_OUTPUT_PATH
807 # assign unit test cases
808 - 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
809 # clone test script to assign tests
810 - git clone $TEST_SCRIPT_REPOSITORY
811 - cd auto_test_script
812 - python $CHECKOUT_REF_SCRIPT auto_test_script
813 # assgin integration test cases
814 - python CIAssignTestCases.py -t $IDF_PATH/components/idf_test/integration_test -c $IDF_PATH/.gitlab-ci.yml -b $IDF_PATH/SSC/ssc_bin
816 .example_test_template: &example_test_template
823 - /^v\d+\.\d+(\.\d+)?($|-)/
827 - $BOT_TRIGGER_WITH_LABEL == null
828 - $BOT_LABEL_EXAMPLE_TEST
831 - build_examples_make_00
832 - build_examples_make_01
833 - build_examples_make_02
834 - build_examples_make_03
835 - build_examples_make_04
836 - build_examples_make_05
837 - build_examples_make_06
838 - build_examples_make_07
839 - build_examples_cmake_00
840 - build_examples_cmake_01
841 - build_examples_cmake_02
842 - build_examples_cmake_03
843 - build_examples_cmake_04
844 - build_examples_cmake_05
845 - build_examples_cmake_06
846 - build_examples_cmake_07
853 junit: $LOG_PATH/*/XUNIT_RESULT.xml
855 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
856 TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
857 CONFIG_FILE: "$CI_PROJECT_DIR/examples/test_configs/$CI_JOB_NAME.yml"
858 LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
859 ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
861 # first test if config file exists, if not exist, exit 0
862 - test -e $CONFIG_FILE || exit 0
863 # clone test env configs
864 - git clone $TEST_ENV_CONFIG_REPOSITORY
865 - cd ci-test-runner-configs
866 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
869 - python Runner.py $TEST_CASE_PATH -c $CONFIG_FILE -e $ENV_FILE
871 .unit_test_template: &unit_test_template
872 <<: *example_test_template
876 - build_esp_idf_tests_make
877 - build_esp_idf_tests_cmake
882 - /^v\d+\.\d+(\.\d+)?($|-)/
886 - $BOT_TRIGGER_WITH_LABEL == null
887 - $BOT_LABEL_UNIT_TEST
889 TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
890 TEST_CASE_PATH: "$CI_PROJECT_DIR/tools/unit-test-app"
891 CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/unit_test/CIConfigs/$CI_JOB_NAME.yml"
892 LOG_PATH: "$CI_PROJECT_DIR/TEST_LOGS"
893 ENV_FILE: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/EnvConfig.yml"
895 .test_template: &test_template
902 - /^v\d+\.\d+(\.\d+)?($|-)/
906 - $BOT_TRIGGER_WITH_LABEL == null
907 - $BOT_LABEL_INTEGRATION_TEST
919 LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
920 LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"
921 TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
922 MODULE_UPDATE_FILE: "$CI_PROJECT_DIR/components/idf_test/ModuleDefinition.yml"
923 CONFIG_FILE: "$CI_PROJECT_DIR/components/idf_test/integration_test/CIConfigs/$CI_JOB_NAME.yml"
924 before_script: *add_gitlab_key_before
926 # first test if config file exists, if not exist, exit 0
927 - test -e $CONFIG_FILE || exit 0
928 # clone local test env configs
929 - git clone $TEST_ENV_CONFIG_REPOSITORY
930 - cd ci-test-runner-configs
931 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
933 - git clone $TEST_SCRIPT_REPOSITORY
934 - cd auto_test_script
935 - python $CHECKOUT_REF_SCRIPT auto_test_script
937 - 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
951 # clone local test env configs
952 - git clone $TEST_ENV_CONFIG_REPOSITORY
953 - cd ci-test-runner-configs
954 - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs
956 - git clone $TEST_SCRIPT_REPOSITORY
957 - cd auto_test_script
958 - git checkout ${CI_COMMIT_REF_NAME} || echo "Using default branch..."
960 - ./Tools/prepare_nvs_bin.sh
962 - 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
965 <<: *example_test_template
971 <<: *example_test_template
977 <<: *example_test_template
978 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
981 - Example_ShieldBox_Basic
984 <<: *example_test_template
990 <<: *example_test_template
996 <<: *example_test_template
1001 example_test_006_01:
1002 <<: *example_test_template
1003 image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
1006 - $BOT_LABEL_IPERF_STRESS_TEST
1011 example_test_007_01:
1012 <<: *example_test_template
1015 - Example_I2C_CCS811_SENSOR
1018 <<: *unit_test_template
1024 <<: *unit_test_template
1030 <<: *unit_test_template
1036 <<: *unit_test_template
1042 <<: *unit_test_template
1048 <<: *unit_test_template
1054 <<: *unit_test_template
1060 <<: *unit_test_template
1066 <<: *unit_test_template
1072 <<: *unit_test_template
1078 <<: *unit_test_template
1084 <<: *unit_test_template
1090 <<: *unit_test_template
1096 <<: *unit_test_template
1102 <<: *unit_test_template
1108 <<: *unit_test_template
1114 <<: *unit_test_template
1120 <<: *unit_test_template
1126 <<: *unit_test_template
1132 <<: *unit_test_template
1138 <<: *unit_test_template
1144 <<: *unit_test_template
1150 <<: *unit_test_template
1156 <<: *unit_test_template
1162 <<: *unit_test_template
1168 <<: *unit_test_template
1174 <<: *unit_test_template
1180 <<: *unit_test_template
1186 <<: *unit_test_template
1192 <<: *unit_test_template
1198 <<: *unit_test_template
1204 <<: *unit_test_template
1210 <<: *unit_test_template
1216 <<: *unit_test_template
1222 <<: *unit_test_template
1228 <<: *unit_test_template
1234 <<: *unit_test_template
1240 <<: *unit_test_template
1246 <<: *unit_test_template
1252 <<: *unit_test_template
1258 <<: *unit_test_template
1264 <<: *unit_test_template
1270 <<: *unit_test_template
1276 <<: *unit_test_template
1282 <<: *unit_test_template
1288 <<: *unit_test_template
1294 <<: *unit_test_template
1300 <<: *unit_test_template
1306 <<: *unit_test_template
1313 <<: *unit_test_template
1320 <<: *unit_test_template
1327 <<: *unit_test_template
1334 <<: *unit_test_template
1341 <<: *unit_test_template
1348 <<: *unit_test_template
1355 <<: *unit_test_template
1362 <<: *unit_test_template
1369 <<: *unit_test_template
1376 <<: *unit_test_template
1383 <<: *unit_test_template
1390 <<: *unit_test_template
1397 <<: *unit_test_template
1404 <<: *unit_test_template
1411 <<: *unit_test_template
1418 <<: *unit_test_template
1425 <<: *unit_test_template
1432 <<: *unit_test_template
1439 <<: *unit_test_template
1445 <<: *unit_test_template
1451 <<: *unit_test_template
1457 <<: *unit_test_template
1464 <<: *unit_test_template
1470 <<: *unit_test_template
1476 <<: *unit_test_template
1482 <<: *unit_test_template
1489 <<: *unit_test_template
1495 <<: *unit_test_template
1501 <<: *unit_test_template
1507 <<: *unit_test_template
1514 <<: *unit_test_template
1520 <<: *unit_test_template
1526 <<: *unit_test_template
1532 <<: *unit_test_template
1539 <<: *unit_test_template
1545 <<: *unit_test_template
1551 <<: *unit_test_template
1557 <<: *unit_test_template
1564 <<: *unit_test_template
1570 <<: *unit_test_template
1576 <<: *unit_test_template
1582 <<: *unit_test_template
1589 <<: *unit_test_template
1596 <<: *unit_test_template
1603 <<: *unit_test_template
1610 <<: *unit_test_template
1617 <<: *unit_test_template
1623 <<: *unit_test_template
1629 <<: *unit_test_template
1635 <<: *unit_test_template
1642 <<: *unit_test_template
1648 <<: *unit_test_template
1654 <<: *unit_test_template
1660 <<: *unit_test_template
1667 <<: *unit_test_template
1673 <<: *unit_test_template
1679 <<: *unit_test_template
1685 <<: *unit_test_template
1692 <<: *unit_test_template