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