12 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
13 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
14 - chmod 600 ~/.ssh/id_rsa
15 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
17 # if testing master branch, use github wifi libs.
18 # if testing other branches, use gitlab wifi libs (as maybe changes aren't merged to master yet)
19 - test "${CI_BUILD_REF_NAME}" = "master" || sed -i "s%https://github.com/espressif/esp32-wifi-lib%ssh://git@gitlab.espressif.cn:27227/idf/esp32-wifi-lib%" .gitmodules
20 # fetch all submodules
21 - git submodule update --init --recursive
25 image: espressif/esp32-ci-env
30 SDK_PATH: "$CI_PROJECT_DIR"
31 IDF_PATH: "$CI_PROJECT_DIR"
35 - git clone https://github.com/espressif/esp-idf-template.git
37 # Try to use the same branch name for esp-idf-template that we're
38 # using on esp-idf. If it doesn't exist then just stick to the default
40 - git checkout ${CI_BUILD_REF_NAME} || echo "Using esp-idf-template default branch..."
42 # Test debug build (default)
44 # Now test release build
46 - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
49 # Check if there are any stray printf/ets_printf references in WiFi libs
50 - cd ../components/esp32/lib
51 - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
52 - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
55 .build_gitlab: &build_template
59 image: espressif/esp32-ci-env
62 SDK_PATH: "$CI_PROJECT_DIR"
63 IDF_PATH: "$CI_PROJECT_DIR"
74 - git clone $GITLAB_SSH_SERVER/yinling/SSC.git
76 - git checkout ${CI_BUILD_REF_NAME} || echo "Using SSC default branch..."
78 - chmod +x gen_misc_ng.sh
85 - ./tools/unit-test-app/build/*.bin
86 - ./tools/unit-test-app/build/*.elf
87 - ./tools/unit-test-app/build/*.map
88 - ./tools/unit-test-app/build/bootloader/*.bin
92 - cd tools/unit-test-app
93 - git checkout ${CI_BUILD_REF_NAME} || echo "Using default branch..."
101 - build_examples/*/*/build/*.bin
102 - build_examples/*/*/build/*.elf
103 - build_examples/*/*/build/*.map
104 - build_examples/*/*/build/bootloader/*.bin
108 # it's not possible to build 100% out-of-tree and have the "artifacts"
109 # mechanism work, but this is the next best thing
110 - mkdir build_examples
112 - ${IDF_PATH}/make/build_examples.sh
116 image: espressif/esp32-ci-env
122 # If not building master branch, and there are Doxygen warnings, print them and bail out
123 - test "${CI_BUILD_REF_NAME}" = "master" || test $(cat doxygen-warning-log.txt | wc -l) -eq 0 || ( echo "Doxygen pass had some warnings:" && cat doxygen-warning-log.txt && false )
133 image: espressif/esp32-ci-env
137 - cd components/nvs_flash/test_nvs_host
142 image: espressif/esp32-ci-env
146 IDF_PATH: "$CI_PROJECT_DIR"
148 - ./make/test_build_system.sh
158 LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
159 TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test"
160 REPORT_PATH: "$CI_PROJECT_DIR/CI_Test_Report"
169 - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git
170 - cd auto_test_script
172 - python CITestReport.py -l $LOG_PATH -t $TEST_CASE_FILE_PATH -p $REPORT_PATH
175 push_master_to_github:
177 - echo "Not setting up GitLab key, not fetching submodules"
184 image: espressif/esp32-ci-env
190 - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
191 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
192 - chmod 600 ~/.ssh/id_rsa
193 - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
194 - git remote add github git@github.com:espressif/esp-idf.git
195 - git push --follow-tags github HEAD:master
200 - echo "Not setting up GitLab key, not fetching submodules"
207 image: espressif/esp32-ci-env
211 - echo -n $DOCS_DEPLOY_KEY > ~/.ssh/id_rsa_base64
212 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
213 - chmod 600 ~/.ssh/id_rsa
214 - echo -e "Host $DOCS_SERVER\n\tStrictHostKeyChecking no\n\tUser $DOCS_SERVER_USER\n" >> ~/.ssh/config
215 - export GIT_VER=$(git describe --always)
218 - tar czvf $GIT_VER.tar.gz $GIT_VER
219 - scp $GIT_VER.tar.gz $DOCS_SERVER:$DOCS_PATH
220 - ssh $DOCS_SERVER -x "cd $DOCS_PATH && tar xzvf $GIT_VER.tar.gz && rm -f latest && ln -s $GIT_VER latest"
223 # AUTO GENERATED PART START, DO NOT MODIFY CONTENT BELOW
224 # template for test jobs
225 .test_template: &test_template
234 # LOCAL_ENV_CONFIG_PATH: define in template and jobs can overwrite if required
235 LOCAL_ENV_CONFIG_PATH: /home/gitlab-runner/LocalConfig/ESP32_IDF
236 BIN_PATH: "$CI_PROJECT_DIR/SSC/ssc_bin/SSC"
238 LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
239 # append test level folder to TEST_CASE_FILE_PATH in before_script of test job
240 TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/integration_test"
241 # jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary
253 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
254 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
255 - chmod 600 ~/.ssh/id_rsa
256 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
258 - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git
259 - cd auto_test_script
261 - python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH
264 # template for overnight test jobs
265 .test_template_night: &test_template_night
268 # can only be triggered
271 # must be night build triggers, otherwise exit without test
272 - test $NIGHT_BUILD = "Yes" || exit 0
276 - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
277 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
278 - chmod 600 ~/.ssh/id_rsa
279 - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
281 - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git
282 - cd auto_test_script
284 - python CIRunner.py -l $LOG_PATH -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH bin_path $APP_NAME $BIN_PATH
286 # template for unit test jobs
287 .unit_test_template: &unit_test_template
293 # jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary
294 LOCAL_ENV_CONFIG_PATH: /home/gitlab-runner/LocalConfig/ESP32_IDF
295 BIN_PATH: "$CI_PROJECT_DIR/tools/unit-test-app/build/"
296 LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
298 TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/unit_test"
301 <<: *unit_test_template
306 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/UT_Function_SYS_01.yml
314 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_SYS_01.yml
323 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_01.yml
332 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_02.yml
334 IT_Function_TCPIP_01:
341 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_01.yml
343 IT_Function_TCPIP_02:
350 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_02.yml
352 IT_Function_TCPIP_03:
359 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_03.yml
361 IT_Function_TCPIP_04:
368 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_04.yml
370 IT_Function_TCPIP_05:
377 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_05.yml
379 IT_Function_TCPIP_06:
380 <<: *test_template_night
385 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_06.yml
393 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_03.yml
401 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_04.yml
409 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_05.yml
417 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_06.yml
419 IT_Function_TCPIP_07:
427 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_07.yml
429 IT_Function_TCPIP_08:
435 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_08.yml
437 IT_Function_TCPIP_09:
443 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_09.yml
445 IT_Function_TCPIP_10:
453 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_10.yml
455 IT_Function_TCPIP_11:
462 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_11.yml
464 IT_Function_TCPIP_12:
470 - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_12.yml