]> granicus.if.org Git - esp-idf/commitdiff
ci: Detect undetectable failures in build_examples
authorAnton Maklakov <anton@espressif.com>
Wed, 31 Oct 2018 10:33:51 +0000 (18:33 +0800)
committerAnton Maklakov <anton@espressif.com>
Thu, 1 Nov 2018 03:38:41 +0000 (11:38 +0800)
.gitlab-ci.yml
tools/ci/build_examples.sh

index 897e612173f94772392ef17e9a5b855b7840e7b6..435b11208cfdc6c0e309beaf551a8ada52c147e2 100644 (file)
@@ -218,6 +218,8 @@ build_esp_idf_tests:
 
 .build_examples_make_template: &build_examples_make_template
   <<: *build_template
+  # This is a workaround for a rarely encountered issue with building examples in CI.
+  # Probably related to building of Kconfig in 'make clean' stage
   retry: 1
   artifacts:
     when: always
@@ -251,7 +253,6 @@ build_esp_idf_tests:
 # same as above, but for CMake
 .build_examples_cmake_template: &build_examples_cmake_template
   <<: *build_template
-  retry: 1
   artifacts:
     when: always
     paths:
index 530d6ab2ec547120bc97194e2e11536d55778598..2210a4b45f6ce0812fdc1057af4c29e6219f674c 100755 (executable)
@@ -121,14 +121,19 @@ build_example () {
         local BUILDLOG=${LOG_PATH}/ex_${ID}_log.txt
         touch ${BUILDLOG}
 
+        local FLASH_ARGS=build/download.config
+
         make clean >>${BUILDLOG} 2>&1 &&
         make defconfig >>${BUILDLOG} 2>&1 &&
         make all >>${BUILDLOG} 2>&1 &&
-        ( make print_flash_cmd | tail -n 1 >build/download.config ) >>${BUILDLOG} 2>&1 ||
+        make print_flash_cmd >${FLASH_ARGS}.full 2>>${BUILDLOG} ||
         {
             RESULT=$?; FAILED_EXAMPLES+=" ${EXAMPLE_NAME}" ;
         }
 
+        tail -n 1 ${FLASH_ARGS}.full > ${FLASH_ARGS} || :
+        test -s ${FLASH_ARGS} || die "Error: ${FLASH_ARGS} file is empty"
+
         cat ${BUILDLOG}
     popd