mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/example_defconfig_ci' into 'master'
ci, examples: use sdkconfig.ci as an extra defaults file, if present See merge request idf/esp-idf!3934
This commit is contained in:
commit
88dc626fd7
@ -1 +0,0 @@
|
||||
|
2
examples/protocols/mqtt/tcp/sdkconfig.ci
Normal file
2
examples/protocols/mqtt/tcp/sdkconfig.ci
Normal file
@ -0,0 +1,2 @@
|
||||
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
|
||||
CONFIG_BROKER_URL="FROM_STDIN"
|
@ -1,7 +0,0 @@
|
||||
CONFIG_BROKER_URL="FROM_STDIN"
|
||||
CONFIG_LOG_DEFAULT_LEVEL_NONE=
|
||||
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
|
||||
CONFIG_LOG_DEFAULT_LEVEL_WARN=
|
||||
CONFIG_LOG_DEFAULT_LEVEL_INFO=
|
||||
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
|
||||
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
|
@ -61,6 +61,7 @@ FAILED_EXAMPLES=""
|
||||
RESULT_ISSUES=22 # magic number result code for issues found
|
||||
LOG_SUSPECTED=${LOG_PATH}/common_log.txt
|
||||
touch ${LOG_SUSPECTED}
|
||||
SDKCONFIG_DEFAULTS_CI=sdkconfig.ci
|
||||
|
||||
EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name Makefile | grep -v "/build_system/cmake/" | sort )
|
||||
|
||||
@ -132,6 +133,16 @@ build_example () {
|
||||
export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
||||
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||
|
||||
# sdkconfig files are normally not checked into git, but may be present when
|
||||
# a developer runs this script locally
|
||||
rm -f sdkconfig
|
||||
|
||||
# If sdkconfig.ci file is present, append it to sdkconfig.defaults,
|
||||
# replacing environment variables
|
||||
if [[ -f "$SDKCONFIG_DEFAULTS_CI" ]]; then
|
||||
cat $SDKCONFIG_DEFAULTS_CI | $IDF_PATH/tools/ci/envsubst.py >> sdkconfig.defaults
|
||||
fi
|
||||
|
||||
# build non-verbose first
|
||||
local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
|
||||
touch ${BUILDLOG}
|
||||
|
@ -64,6 +64,7 @@ FAILED_EXAMPLES=""
|
||||
RESULT_ISSUES=22 # magic number result code for issues found
|
||||
LOG_SUSPECTED=${LOG_PATH}/common_log.txt
|
||||
touch ${LOG_SUSPECTED}
|
||||
SDKCONFIG_DEFAULTS_CI=sdkconfig.ci
|
||||
|
||||
EXAMPLE_PATHS=$( find ${IDF_PATH}/examples/ -type f -name CMakeLists.txt | grep -v "/components/" | grep -v "/main/" | sort )
|
||||
|
||||
@ -122,6 +123,16 @@ build_example () {
|
||||
export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
|
||||
export EXTRA_CXXFLAGS=${EXTRA_CFLAGS}
|
||||
|
||||
# sdkconfig files are normally not checked into git, but may be present when
|
||||
# a developer runs this script locally
|
||||
rm -f sdkconfig
|
||||
|
||||
# If sdkconfig.ci file is present, append it to sdkconfig.defaults,
|
||||
# replacing environment variables
|
||||
if [[ -f "$SDKCONFIG_DEFAULTS_CI" ]]; then
|
||||
cat $SDKCONFIG_DEFAULTS_CI | $IDF_PATH/tools/ci/envsubst.py >> sdkconfig.defaults
|
||||
fi
|
||||
|
||||
# build non-verbose first
|
||||
local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
|
||||
touch ${BUILDLOG}
|
||||
@ -130,7 +141,7 @@ build_example () {
|
||||
idf.py fullclean >>${BUILDLOG} 2>&1 &&
|
||||
idf.py build >>${BUILDLOG} 2>&1
|
||||
else
|
||||
rm -rf build sdkconfig &&
|
||||
rm -rf build &&
|
||||
./build.sh >>${BUILDLOG} 2>&1
|
||||
fi &&
|
||||
cp build/flash_project_args build/download.config || # backwards compatible download.config filename
|
||||
|
27
tools/ci/envsubst.py
Executable file
27
tools/ci/envsubst.py
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# A script similar to GNU envsubst, but filters out
|
||||
# some CI related variables.
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
# Sanitize environment variables
|
||||
vars_to_remove = []
|
||||
for var_name in os.environ.iterkeys():
|
||||
if var_name.startswith('CI_'):
|
||||
vars_to_remove.append(var_name)
|
||||
for var_name in vars_to_remove:
|
||||
del os.environ[var_name]
|
||||
|
||||
for line in sys.stdin:
|
||||
if not line:
|
||||
break
|
||||
sys.stdout.write(os.path.expandvars(line))
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -21,6 +21,7 @@ tools/ci/build_examples_cmake.sh
|
||||
tools/ci/check-executable.sh
|
||||
tools/ci/check-line-endings.sh
|
||||
tools/ci/checkout_project_ref.py
|
||||
tools/ci/envsubst.py
|
||||
tools/ci/get-full-sources.sh
|
||||
tools/ci/mirror-submodule-update.sh
|
||||
tools/ci/mirror-synchronize.sh
|
||||
|
@ -107,8 +107,8 @@ function(kconfig_process_config)
|
||||
set(defaults_arg --defaults "${IDF_SDKCONFIG_DEFAULTS}")
|
||||
endif()
|
||||
|
||||
if(EXISTS "${SDKCONFIG_DEFAULTS}.${IDF_TARGET}")
|
||||
list(APPEND defaults_arg --defaults "${SDKCONFIG_DEFAULTS}.${IDF_TARGET}")
|
||||
if(EXISTS "${IDF_SDKCONFIG_DEFAULTS}.${IDF_TARGET}")
|
||||
list(APPEND defaults_arg --defaults "${IDF_SDKCONFIG_DEFAULTS}.${IDF_TARGET}")
|
||||
endif()
|
||||
|
||||
# Set these in the parent scope, so that they can be written to project_description.json
|
||||
|
Loading…
Reference in New Issue
Block a user