summaryrefslogtreecommitdiff
path: root/.ci
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2021-07-13 14:17:53 +0200
committerIlya Maximets <i.maximets@ovn.org>2021-07-16 13:54:25 +0200
commit6c41bcb138b359b075e2c243a32fb68f095fcc91 (patch)
treec9ff4df58dd071ddf18cad342901484c9689d24e /.ci
parent7ab851e1b8cf27f82a583b6f0b99f66fa18375d3 (diff)
downloadopenvswitch-6c41bcb138b359b075e2c243a32fb68f095fcc91.tar.gz
ci: Do not dump logs on error for GitHub Actions.
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 <david.marchand@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to '.ci')
-rwxr-xr-x.ci/linux-build.sh27
-rwxr-xr-x.ci/osx-build.sh30
2 files changed, 38 insertions, 19 deletions
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 0210d6a77..863f02388 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -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
@@ -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()
@@ -180,7 +195,7 @@ function build_ovs()
make -j4
popd
else
- make -j4 || { cat config.log; exit 1; }
+ make -j4
fi
}
@@ -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
diff --git a/.ci/osx-build.sh b/.ci/osx-build.sh
index bf2c13fa3..f8facebeb 100755
--- a/.ci/osx-build.sh
+++ b/.ci/osx-build.sh
@@ -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 $*
@@ -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