Parcourir la source

CI build_examples: Correctly detect example build failures

"pipefail" regression when fail-on-warnings was added...
Angus Gratton il y a 9 ans
Parent
commit
79d6d9f701
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      make/build_examples.sh

+ 3 - 2
make/build_examples.sh

@@ -30,10 +30,11 @@ for example in ${IDF_PATH}/examples/*; do
    # build non-verbose first
    BUILDLOG=$(mktemp -t examplebuild.XXXX.log)
    (
+       set -o pipefail  # so result of make all isn't lost when piping to tee
        set -e
        make clean defconfig
-       make all 2>&1 | tee $BUILDLOG
-    ) || (RESULT=$?; make V=1) # only build verbose if there's an error
+       make $* all 2>&1 | tee $BUILDLOG
+    ) || { RESULT=$?; make V=1; } # only build verbose if there's an error
     popd
     EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))