mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(ci): add CI check for EXTRA_COMPONENT_DIRS in examples
This commit is contained in:
parent
6d87100a70
commit
8c26ddf4a1
@ -64,11 +64,12 @@ check_version:
|
||||
- export IDF_PATH=$PWD
|
||||
- tools/ci/check_idf_version.sh
|
||||
|
||||
check_rom_api_header:
|
||||
check_api_usage:
|
||||
extends: .pre_check_template
|
||||
script:
|
||||
- tools/ci/check_examples_rom_header.sh
|
||||
- tools/ci/check_api_violation.sh
|
||||
- tools/ci/check_examples_extra_component_dirs.sh
|
||||
|
||||
test_check_kconfigs:
|
||||
extends: .pre_check_template
|
||||
|
25
tools/ci/check_examples_extra_component_dirs.sh
Executable file
25
tools/ci/check_examples_extra_component_dirs.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
# Examples shouldn't use EXTRA_COMPONENT_DIRS, instead the dependencies should be specified in idf_component.yml files
|
||||
|
||||
output=$(find ${IDF_PATH}/examples -name "CMakeLists.txt" -not -path "**/managed_components/**" -not -path "**/build/**")
|
||||
files=$(egrep "set\(EXTRA_COMPONENT_DIRS" ${output} | cut -d ":" -f 1)
|
||||
found_issues=0
|
||||
for file in ${files}
|
||||
do
|
||||
if [ "$file" == "${IDF_PATH}/examples/system/unit_test/test/CMakeLists.txt" ]; then
|
||||
# this specific one is okay
|
||||
continue
|
||||
fi
|
||||
echo "${file} uses EXTRA_COMPONENT_DIRS. Change it to reference the component using idf_component.yml file."
|
||||
((found_issues++))
|
||||
done
|
||||
|
||||
if [ $found_issues -eq 0 ]; then
|
||||
echo "No examples use EXTRA_COMPONENT_DIRS"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exit 1
|
@ -55,6 +55,7 @@ tools/ci/check_callgraph.py
|
||||
tools/ci/check_codeowners.py
|
||||
tools/ci/check_deprecated_kconfigs.py
|
||||
tools/ci/check_esp_memory_utils_headers.sh
|
||||
tools/ci/check_examples_extra_component_dirs.sh
|
||||
tools/ci/check_examples_rom_header.sh
|
||||
tools/ci/check_executables.py
|
||||
tools/ci/check_idf_version.sh
|
||||
|
Loading…
Reference in New Issue
Block a user