mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-03 23:48:59 +08:00
tools(ci): Support multiple CI sdkconfig files
This commit is contained in:
1
examples/get-started/hello_world/sdkconfig.ci.2MB
Normal file
1
examples/get-started/hello_world/sdkconfig.ci.2MB
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
|
1
examples/get-started/hello_world/sdkconfig.ci.4MB
Normal file
1
examples/get-started/hello_world/sdkconfig.ci.4MB
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
@ -118,14 +118,35 @@ build_example () {
|
||||
local EXAMPLE_DIR=$(dirname "${MAKE_FILE}")
|
||||
local EXAMPLE_NAME=$(basename "${EXAMPLE_DIR}")
|
||||
|
||||
local EXAMPLE_BUILD_DIR="${ID}_${EXAMPLE_NAME}"
|
||||
local EXAMPLE_BUILD_DIRS=()
|
||||
|
||||
# count number of CI sdkconfig files
|
||||
SDKCONFIG_CI_FILES=$( find ${EXAMPLE_DIR}/ -type f -name sdkconfig.ci.* | sort )
|
||||
if [[ -z ${SDKCONFIG_CI_FILES} ]]; then
|
||||
EXAMPLE_BUILD_DIRS[0]="${ID}_${EXAMPLE_NAME}"
|
||||
else
|
||||
COUNT=0
|
||||
for CI_FILE in ${SDKCONFIG_CI_FILES}
|
||||
do
|
||||
EXAMPLE_BUILD_DIRS[COUNT]="${ID}_${EXAMPLE_NAME}_${CI_FILE##*.}"
|
||||
COUNT=$(( $COUNT + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
for EXAMPLE_BUILD_DIR in ${EXAMPLE_BUILD_DIRS[*]}
|
||||
do
|
||||
if [[ -f "example_builds/${EXAMPLE_BUILD_DIR}/build/ci_build_success" ]]; then
|
||||
echo "Project ${EXAMPLE_BUILD_DIR} has been built and skip building ..."
|
||||
else
|
||||
echo "Building ${EXAMPLE_BUILD_DIR}..."
|
||||
mkdir -p "example_builds/${EXAMPLE_BUILD_DIR}"
|
||||
cp -r "${EXAMPLE_DIR}/"* "example_builds/${EXAMPLE_BUILD_DIR}/"
|
||||
|
||||
if [[ -n ${SDKCONFIG_CI_FILES} ]]; then
|
||||
cp "example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci.${EXAMPLE_BUILD_DIR##*_}" "example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci"
|
||||
rm example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci.*
|
||||
fi
|
||||
|
||||
pushd "example_builds/${EXAMPLE_BUILD_DIR}"
|
||||
# be stricter in the CI build than the default IDF settings
|
||||
export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
||||
@ -165,6 +186,7 @@ build_example () {
|
||||
|
||||
grep -i "error\|warning" "${BUILDLOG}" 2>&1 >> "${LOG_SUSPECTED}" || :
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
EXAMPLE_NUM=0
|
||||
|
@ -132,14 +132,36 @@ build_example () {
|
||||
local EXAMPLE_DIR=$(dirname "${CMAKELISTS}")
|
||||
local EXAMPLE_NAME=$(basename "${EXAMPLE_DIR}")
|
||||
|
||||
local EXAMPLE_BUILD_DIR="${ID}_${EXAMPLE_NAME}"
|
||||
local EXAMPLE_BUILD_DIRS=()
|
||||
|
||||
# count number of CI sdkconfig files
|
||||
SDKCONFIG_CI_FILES=$( find ${EXAMPLE_DIR}/ -type f -name sdkconfig.ci.* | sort )
|
||||
if [[ -z ${SDKCONFIG_CI_FILES} ]]; then
|
||||
EXAMPLE_BUILD_DIRS[0]="${ID}_${EXAMPLE_NAME}"
|
||||
else
|
||||
COUNT=0
|
||||
for CI_FILE in ${SDKCONFIG_CI_FILES}
|
||||
do
|
||||
echo "${COUNT} ${CI_FILE}"
|
||||
EXAMPLE_BUILD_DIRS[COUNT]="${ID}_${EXAMPLE_NAME}_${CI_FILE##*.}"
|
||||
COUNT=$(( $COUNT + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
for EXAMPLE_BUILD_DIR in ${EXAMPLE_BUILD_DIRS[*]}
|
||||
do
|
||||
if [[ -f "example_builds/${EXAMPLE_BUILD_DIR}/build/ci_build_success" ]]; then
|
||||
echo "Project ${EXAMPLE_NAME} has been built and skip building ..."
|
||||
echo "Project ${EXAMPLE_BUILD_DIR} has been built and skip building ..."
|
||||
else
|
||||
echo "Building ${EXAMPLE_BUILD_DIR}..."
|
||||
mkdir -p "example_builds/${EXAMPLE_BUILD_DIR}"
|
||||
cp -r "${EXAMPLE_DIR}/"* "example_builds/${EXAMPLE_BUILD_DIR}"
|
||||
cp -r "${EXAMPLE_DIR}/"* "example_builds/${EXAMPLE_BUILD_DIR}/"
|
||||
|
||||
if [[ -n ${SDKCONFIG_CI_FILES} ]]; then
|
||||
cp "example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci.${EXAMPLE_BUILD_DIR##*_}" "example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci"
|
||||
rm example_builds/${EXAMPLE_BUILD_DIR}/sdkconfig.ci.*
|
||||
fi
|
||||
|
||||
pushd "example_builds/${EXAMPLE_BUILD_DIR}"
|
||||
# be stricter in the CI build than the default IDF settings
|
||||
export EXTRA_CFLAGS="-Werror -Werror=deprecated-declarations"
|
||||
@ -173,6 +195,7 @@ build_example () {
|
||||
|
||||
grep -i "error\|warning" "${BUILDLOG}" 2>&1 | grep -v "error.c.obj" >> "${LOG_SUSPECTED}" || :
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
EXAMPLE_NUM=0
|
||||
|
Reference in New Issue
Block a user