Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74d8806

Browse files
committed
Merge branch 'bugfix/build_example_make' into 'master'
Better detection failures in built_examples See merge request idf/esp-idf!3604
2 parents 3f82d21 + 0fb6f61 commit 74d8806

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ build_esp_idf_tests:
218218

219219
.build_examples_make_template: &build_examples_make_template
220220
<<: *build_template
221+
# This is a workaround for a rarely encountered issue with building examples in CI.
222+
# Probably related to building of Kconfig in 'make clean' stage
221223
retry: 1
222224
artifacts:
223225
when: always
@@ -251,7 +253,6 @@ build_esp_idf_tests:
251253
# same as above, but for CMake
252254
.build_examples_cmake_template: &build_examples_cmake_template
253255
<<: *build_template
254-
retry: 1
255256
artifacts:
256257
when: always
257258
paths:

tools/ci/build_examples.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ else
7575
[ -z ${JOB_PATTERN} ] && die "JOB_PATTERN is bad"
7676

7777
# parse number 'NUM' at the end of string 'some_your_text_NUM'
78-
JOB_NUM=$( echo ${JOB_NAME} | sed -n -r 's/^.*_([0-9]+)$/\1/p' )
78+
# NOTE: Getting rid of the leading zero to get the decimal
79+
JOB_NUM=$( echo ${JOB_NAME} | sed -n -r 's/^.*_0*([0-9]+)$/\1/p' )
7980
[ -z ${JOB_NUM} ] && die "JOB_NUM is bad"
8081

8182
# count number of the jobs
@@ -120,14 +121,19 @@ build_example () {
120121
local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
121122
touch ${BUILDLOG}
122123

124+
local FLASH_ARGS=build/download.config
125+
123126
make clean >>${BUILDLOG} 2>&1 &&
124127
make defconfig >>${BUILDLOG} 2>&1 &&
125128
make all >>${BUILDLOG} 2>&1 &&
126-
( make print_flash_cmd | tail -n 1 >build/download.config ) >>${BUILDLOG} 2>&1 ||
129+
make print_flash_cmd >${FLASH_ARGS}.full 2>>${BUILDLOG} ||
127130
{
128131
RESULT=$?; FAILED_EXAMPLES+=" ${EXAMPLE_NAME}" ;
129132
}
130133

134+
tail -n 1 ${FLASH_ARGS}.full > ${FLASH_ARGS} || :
135+
test -s ${FLASH_ARGS} || die "Error: ${FLASH_ARGS} file is empty"
136+
131137
cat ${BUILDLOG}
132138
popd
133139

tools/ci/build_examples_cmake.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ else
8080
[ -z ${JOB_PATTERN} ] && die "JOB_PATTERN is bad"
8181

8282
# parse number 'NUM' at the end of string 'some_your_text_NUM'
83-
JOB_NUM=$( echo ${JOB_NAME} | sed -n -r 's/^.*_([0-9]+)$/\1/p' )
83+
# NOTE: Getting rid of the leading zero to get the decimal
84+
JOB_NUM=$( echo ${JOB_NAME} | sed -n -r 's/^.*_0*([0-9]+)$/\1/p' )
8485
[ -z ${JOB_NUM} ] && die "JOB_NUM is bad"
8586

8687
# count number of the jobs

0 commit comments

Comments
 (0)