Skip to content

Commit

Permalink
ci: Do not dump logs on error for GitHub Actions.
Browse files Browse the repository at this point in the history
GHA webui directly focus on the last lines for a failing step.
config and testsuite logs are attached as artifacts in GHA in case of
failures, so dumping them just adds noise.
Skip dumping those files. Travis is left untouched though

Signed-off-by: David Marchand <[email protected]>
Acked-by: Aaron Conole <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
david-marchand authored and igsilya committed Jul 16, 2021
1 parent 7ab851e commit 6c41bcb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
27 changes: 19 additions & 8 deletions .ci/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ CFLAGS_FOR_OVS="-g -O2"
SPARSE_FLAGS=""
EXTRA_OPTS="--enable-Werror"

on_exit() {
if [ $? = 0 ]; then
exit
fi
FILES_TO_PRINT="config.log"
FILES_TO_PRINT="$FILES_TO_PRINT */_build/sub/tests/testsuite.log"

for pr_file in $FILES_TO_PRINT; do
cat "$pr_file" 2>/dev/null
done
}
# We capture the error logs as artifacts in Github Actions, no need to dump
# them via a EXIT handler.
[ -n "$GITHUB_WORKFLOW" ] || trap on_exit EXIT

function install_kernel()
{
if [[ "$1" =~ ^5.* ]]; then
Expand Down Expand Up @@ -163,7 +178,7 @@ function install_dpdk()
function configure_ovs()
{
./boot.sh
./configure CFLAGS="${CFLAGS_FOR_OVS}" $* || { cat config.log; exit 1; }
./configure CFLAGS="${CFLAGS_FOR_OVS}" $*
}

function build_ovs()
Expand All @@ -180,7 +195,7 @@ function build_ovs()
make -j4
popd
else
make -j4 || { cat config.log; exit 1; }
make -j4
fi
}

Expand Down Expand Up @@ -244,12 +259,8 @@ if [ "$TESTSUITE" ]; then
configure_ovs

export DISTCHECK_CONFIGURE_FLAGS="$OPTS"
if ! make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
TESTSUITEFLAGS=-j4 RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/sub/tests/testsuite.log
exit 1
fi
make distcheck -j4 CFLAGS="${CFLAGS_FOR_OVS}" \
TESTSUITEFLAGS=-j4 RECHECK=yes
else
if [ -z "${KERNEL_LIST}" ]; then build_ovs ${KERNEL};
else
Expand Down
30 changes: 19 additions & 11 deletions .ci/osx-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ set -o errexit
CFLAGS="-Werror $CFLAGS"
EXTRA_OPTS=""

on_exit() {
if [ $? = 0 ]; then
exit
fi
FILES_TO_PRINT="config.log"
FILES_TO_PRINT="$FILES_TO_PRINT */_build/sub/tests/testsuite.log"

for pr_file in $FILES_TO_PRINT; do
cat "$pr_file" 2>/dev/null
done
}
# We capture the error logs as artifacts in Github Actions, no need to dump
# them via a EXIT handler.
[ -n "$GITHUB_WORKFLOW" ] || trap on_exit EXIT

function configure_ovs()
{
./boot.sh && ./configure $*
Expand All @@ -13,20 +28,13 @@ function configure_ovs()
configure_ovs $EXTRA_OPTS $*

if [ "$CC" = "clang" ]; then
set make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
else
set make CFLAGS="$CFLAGS $BUILD_ENV"
fi
if ! "$@"; then
cat config.log
exit 1
make CFLAGS="$CFLAGS $BUILD_ENV"
fi

if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then
if ! make distcheck RECHECK=yes; then
# testsuite.log is necessary for debugging.
cat */_build/sub/tests/testsuite.log
exit 1
fi
make distcheck RECHECK=yes
fi

exit 0

0 comments on commit 6c41bcb

Please sign in to comment.