2020-09-27 03:20:53 +00:00
|
|
|
.pre_check_base_template:
|
|
|
|
stage: pre_check
|
2021-05-26 08:44:20 +00:00
|
|
|
image: $ESP_ENV_IMAGE
|
2020-09-27 03:20:53 +00:00
|
|
|
tags:
|
|
|
|
- host_test
|
|
|
|
dependencies: []
|
|
|
|
|
|
|
|
.pre_check_job_template:
|
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
2021-02-09 04:31:38 +00:00
|
|
|
- .before_script_no_sync_submodule
|
2020-09-27 03:20:53 +00:00
|
|
|
|
2020-10-21 11:30:49 +00:00
|
|
|
.check_pre_commit_template:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends: .pre_check_job_template
|
2020-10-21 11:30:49 +00:00
|
|
|
image: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
|
|
|
|
before_script:
|
|
|
|
- source tools/ci/utils.sh
|
|
|
|
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
|
|
|
|
|
|
|
|
check_pre_commit_master_release:
|
|
|
|
extends:
|
|
|
|
- .check_pre_commit_template
|
|
|
|
- .rules:protected
|
2019-11-12 07:59:11 +00:00
|
|
|
script:
|
2020-10-21 11:30:49 +00:00
|
|
|
- git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | xargs pre-commit run --files
|
2019-11-12 07:59:11 +00:00
|
|
|
|
2020-10-21 11:30:49 +00:00
|
|
|
check_pre_commit_MR:
|
|
|
|
extends:
|
|
|
|
- .check_pre_commit_template
|
|
|
|
- .rules:dev
|
2019-11-12 07:59:11 +00:00
|
|
|
script:
|
2021-03-01 07:20:34 +00:00
|
|
|
- python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | xargs pre-commit run --files
|
2019-11-12 07:59:11 +00:00
|
|
|
|
|
|
|
check_version:
|
|
|
|
# Don't run this for feature/bugfix branches, so that it is possible to modify
|
|
|
|
# esp_idf_version.h in a branch before tagging the next version.
|
2020-09-27 03:20:53 +00:00
|
|
|
extends:
|
|
|
|
- .pre_check_job_template
|
2020-10-20 07:00:50 +00:00
|
|
|
- .rules:protected
|
2019-11-12 07:59:11 +00:00
|
|
|
script:
|
|
|
|
- export IDF_PATH=$PWD
|
|
|
|
- tools/ci/check_idf_version.sh
|
|
|
|
|
|
|
|
check_examples_cmake_make:
|
2021-02-09 04:31:38 +00:00
|
|
|
extends: .pre_check_job_template
|
2019-11-12 07:59:11 +00:00
|
|
|
script:
|
2021-02-09 04:31:38 +00:00
|
|
|
- python ${IDF_PATH}/tools/ci/check_examples_cmake_make.py
|
2019-11-12 07:59:11 +00:00
|
|
|
|
2020-06-19 04:00:58 +00:00
|
|
|
check_rom_api_header:
|
2021-02-09 04:31:38 +00:00
|
|
|
extends: .pre_check_job_template
|
2019-11-12 07:59:11 +00:00
|
|
|
script:
|
|
|
|
- tools/ci/check_examples_rom_header.sh
|
2021-06-15 09:11:50 +00:00
|
|
|
- tools/ci/check_api_violation.sh
|
2019-11-12 07:59:11 +00:00
|
|
|
|
|
|
|
check_python_style:
|
2020-11-30 09:40:24 +00:00
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
|
|
|
- .rules:patterns:python-files
|
2021-05-26 08:44:20 +00:00
|
|
|
variables:
|
|
|
|
PYTHON_VER: 3.6.13
|
2019-11-12 07:59:11 +00:00
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- flake8_output.txt
|
|
|
|
expire_in: 1 week
|
|
|
|
script:
|
2021-05-26 08:44:20 +00:00
|
|
|
- python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH
|
2019-11-12 07:59:11 +00:00
|
|
|
|
2021-02-09 04:31:38 +00:00
|
|
|
test_check_kconfigs:
|
|
|
|
extends: .pre_check_job_template
|
2021-05-26 08:44:20 +00:00
|
|
|
variables:
|
|
|
|
PYTHON_VER: 3.6.13
|
2019-11-12 07:59:11 +00:00
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- components/*/Kconfig*.new
|
|
|
|
- examples/*/*/*/Kconfig*.new
|
|
|
|
- examples/*/*/*/*/Kconfig*.new
|
|
|
|
- tools/*/Kconfig*.new
|
|
|
|
- tools/*/*/Kconfig*.new
|
|
|
|
- tools/*/*/*/Kconfig*.new
|
|
|
|
expire_in: 1 week
|
|
|
|
script:
|
2021-05-26 08:44:20 +00:00
|
|
|
- python ${IDF_PATH}/tools/ci/test_check_kconfigs.py
|
2019-11-12 07:59:11 +00:00
|
|
|
|
2019-12-11 03:40:20 +00:00
|
|
|
check_wifi_lib_md5:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends: .pre_check_base_template
|
2019-12-11 03:40:20 +00:00
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
variables:
|
|
|
|
SUBMODULES_TO_FETCH: "components/esp_wifi/lib"
|
|
|
|
script:
|
|
|
|
- IDF_TARGET=esp32 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
|
2020-01-17 03:47:08 +00:00
|
|
|
- IDF_TARGET=esp32s2 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
|
2019-12-11 03:40:20 +00:00
|
|
|
|
2021-02-05 13:56:09 +00:00
|
|
|
check_fuzzer_compilation:
|
|
|
|
extends: .pre_check_base_template
|
2021-05-26 08:44:20 +00:00
|
|
|
image: $AFL_FUZZER_TEST_IMAGE
|
2021-02-05 13:56:09 +00:00
|
|
|
script:
|
|
|
|
- cd ${IDF_PATH}/components/lwip/test_afl_host
|
|
|
|
- make MODE=dhcp_server
|
|
|
|
- make MODE=dhcp_client
|
|
|
|
- make MODE=dns
|
|
|
|
- cd ${IDF_PATH}/components/mdns/test_afl_fuzz_host
|
|
|
|
- make
|
|
|
|
|
2019-12-25 20:03:41 +00:00
|
|
|
check_public_headers:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
2021-02-09 04:31:38 +00:00
|
|
|
- .rules:build
|
2019-12-18 15:11:11 +00:00
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
script:
|
2020-03-02 09:19:01 +00:00
|
|
|
- python tools/ci/check_public_headers.py --jobs 4 --prefix xtensa-esp32-elf-
|
2019-12-18 15:11:11 +00:00
|
|
|
|
2021-08-23 06:03:23 +00:00
|
|
|
check_soc_struct_headers:
|
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
|
|
|
- .rules:build
|
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
script:
|
|
|
|
- find ${IDF_PATH}/components/soc/*/include/soc/ -name "*_struct.h" -print0 | xargs -0 -n1 ./tools/ci/check_soc_struct_headers.py
|
|
|
|
|
2021-06-21 02:47:34 +00:00
|
|
|
check_esp_err_to_name:
|
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
|
|
|
- .rules:build
|
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- components/esp_common/esp_err_to_name.c
|
|
|
|
expire_in: 1 week
|
|
|
|
script:
|
|
|
|
- cd ${IDF_PATH}/tools/
|
2021-05-26 08:44:20 +00:00
|
|
|
- ./gen_esp_err_to_name.py
|
2021-06-21 02:47:34 +00:00
|
|
|
- git diff --exit-code -- ../components/esp_common/src/esp_err_to_name.c || { echo 'Differences found. Please run gen_esp_err_to_name.py and commit the changes.'; exit 1; }
|
|
|
|
|
2021-02-09 04:31:38 +00:00
|
|
|
scan_tests:
|
|
|
|
extends:
|
|
|
|
- .pre_check_base_template
|
2021-02-22 08:53:37 +00:00
|
|
|
- .rules:build:target_test
|
2020-04-20 06:30:31 +00:00
|
|
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
tags:
|
|
|
|
- assign_test
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- $EXAMPLE_TEST_OUTPUT_DIR
|
|
|
|
- $TEST_APPS_OUTPUT_DIR
|
2020-08-21 06:42:25 +00:00
|
|
|
- $COMPONENT_UT_OUTPUT_DIR
|
2020-04-20 06:30:31 +00:00
|
|
|
variables:
|
|
|
|
EXAMPLE_TEST_DIR: ${CI_PROJECT_DIR}/examples
|
|
|
|
EXAMPLE_TEST_OUTPUT_DIR: ${CI_PROJECT_DIR}/examples/test_configs
|
|
|
|
TEST_APPS_TEST_DIR: ${CI_PROJECT_DIR}/tools/test_apps
|
|
|
|
TEST_APPS_OUTPUT_DIR: ${CI_PROJECT_DIR}/tools/test_apps/test_configs
|
2020-08-21 06:42:25 +00:00
|
|
|
COMPONENT_UT_OUTPUT_DIR: ${CI_PROJECT_DIR}/component_ut/test_configs
|
2021-02-09 04:31:38 +00:00
|
|
|
CI_SCAN_TESTS_PY: ${CI_PROJECT_DIR}/tools/ci/python_packages/ttfw_idf/CIScanTests.py
|
2020-04-20 06:30:31 +00:00
|
|
|
script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- set_component_ut_vars
|
2021-02-09 04:31:38 +00:00
|
|
|
- run_cmd python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b make --exclude examples/build_system/idf_as_lib -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR
|
|
|
|
- run_cmd python $CI_SCAN_TESTS_PY example_test $EXAMPLE_TEST_DIR -b cmake --exclude examples/build_system/idf_as_lib -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_OUTPUT_DIR
|
|
|
|
- run_cmd python $CI_SCAN_TESTS_PY test_apps $TEST_APPS_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $TEST_APPS_OUTPUT_DIR
|
|
|
|
- run_cmd python $CI_SCAN_TESTS_PY component_ut $COMPONENT_UT_DIRS --exclude $COMPONENT_UT_EXCLUDES -c $CI_TARGET_TEST_CONFIG_FILE -o $COMPONENT_UT_OUTPUT_DIR
|
2020-06-16 11:00:27 +00:00
|
|
|
|
2020-10-06 22:54:27 +00:00
|
|
|
# For release tag pipelines only, make sure the tag was created with 'git tag -a' so it will update
|
|
|
|
# the version returned by 'git describe'
|
|
|
|
check_version_tag:
|
2020-09-27 03:20:53 +00:00
|
|
|
extends:
|
|
|
|
- .pre_check_job_template
|
2021-02-09 04:31:38 +00:00
|
|
|
- .rules:tag:release
|
2020-10-06 22:54:27 +00:00
|
|
|
script:
|
2020-11-22 23:23:24 +00:00
|
|
|
- (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || (echo "ESP-IDF versions must be annotated tags." && exit 1)
|
2021-02-02 02:53:40 +00:00
|
|
|
|
2021-02-09 04:31:38 +00:00
|
|
|
check_ut_cmake_make:
|
|
|
|
extends: .pre_check_job_template
|
|
|
|
tags:
|
|
|
|
- build
|
|
|
|
script:
|
|
|
|
- tools/ci/check_ut_cmake_make.sh
|
|
|
|
|
|
|
|
check_artifacts_expire_time:
|
|
|
|
extends: .pre_check_job_template
|
|
|
|
script:
|
|
|
|
# check if we have set expire time for all artifacts
|
|
|
|
- python tools/ci/check_artifacts_expire_time.py
|
|
|
|
|
|
|
|
check_commit_msg:
|
|
|
|
extends: .pre_check_job_template
|
|
|
|
script:
|
|
|
|
- git status
|
|
|
|
- git log -n10 --oneline
|
|
|
|
# commit start with "WIP: " need to be squashed before merge
|
|
|
|
- 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
|
|
|
|
|
2021-02-02 02:53:40 +00:00
|
|
|
check_tools_file_patterns:
|
|
|
|
extends: .pre_check_job_template
|
|
|
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
variables:
|
|
|
|
PYTHON_VER: 3.7.7
|
|
|
|
script:
|
|
|
|
- python tools/ci/check_tools_files_patterns.py
|
|
|
|
allow_failure: true
|