ci: add folding for travis logs

make the build a bit nicer to read

the build output is still insanely verbose, so this isn't super useful as
the 'pretty' view still takes so long to load that it's almost always better
to just read the raw text log

Differential Revision: https://phab.enlightenment.org/D6616
This commit is contained in:
Mike Blumenkrantz 2018-07-13 18:29:25 -04:00 committed by Stefan Schmidt
parent d568c6f125
commit c06be53b03
8 changed files with 56 additions and 13 deletions

View File

@ -2,6 +2,8 @@
set -e
. .ci/travis.sh
CI_BUILD_TYPE="$1"
DEFAULT_LINUX_COPTS="--prefix=/usr/ --with-tests=regular --disable-cxx-bindings -C"
@ -47,9 +49,16 @@ if [ "$DISTRO" != "" ] ; then
OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
fi
docker exec $(cat $HOME/cid) sh -c 'rm -f ~/.ccache/ccache.conf'
travis_fold autoreconf autoreconf
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
--env CXX="ccache g++" --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
$(cat $HOME/cid) sh -c "autoreconf -iv && ./configure $OPTS"
$(cat $HOME/cid) sh -c "autoreconf -iv"
travis_endfold autoreconf
travis_fold configure "configure $OPTS"
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
--env CXX="ccache g++" --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
$(cat $HOME/cid) sh -c "./configure $OPTS"
travis_endfold configure
else
OSX_COPTS="--disable-cxx-bindings --with-tests=regular -C"
@ -65,6 +74,10 @@ else
# Normal build test of all targets
rm -f ~/.ccache/ccache.conf
travis_fold autoreconf autoreconf
autoreconf -iv
travis_endfold autoreconf
travis_fold configure "configure $OSX_COPTS"
./configure $OSX_COPTS
travis_endfold configure
fi

View File

@ -1,14 +1,15 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" = "release-ready" ] ; then
exit 0
fi
travis_fold benchmark "make benchmark"
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make benchmark
else
export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
make benchmark
fi
travis_endfold benchmark

View File

@ -1,14 +1,15 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" = "release-ready" ] ; then
exit 0
fi
travis_fold check-build "make check-build"
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make check-build
else
export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
make check-build
fi
travis_endfold check-build

View File

@ -1,11 +1,11 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" != "release-ready" ] ; then
exit 0
fi
travis_fold distcheck "make distcheck"
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
--env CXX="ccache g++" \
@ -15,3 +15,4 @@ else
export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
make
fi
travis_endfold distcheck

View File

@ -1,14 +1,15 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" = "release-ready" ] ; then
exit 0
fi
travis_fold examples "make examples"
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make examples
else
export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
make examples
fi
travis_endfold examples

View File

@ -1,14 +1,15 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" = "release-ready" ] ; then
exit 0
fi
travis_fold install "make install"
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make install
else
export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
make install
fi
travis_endfold install

View File

@ -1,14 +1,15 @@
#!/bin/sh
set -e
. .ci/travis.sh
if [ "$1" = "release-ready" ] ; then
exit 0
fi
travis_fold make make
if [ "$DISTRO" != "" ] ; then
docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make
else
export PATH="$(brew --prefix gettext)/bin:$PATH"
make
fi
travis_endfold make

24
.ci/travis.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# https://github.com/travis-ci/travis-rubies/blob/9f7962a881c55d32da7c76baefc58b89e3941d91/build.sh#L38-L44
travis_fold() {
echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
}
travis_endfold() {
echo -e "\ntravis_fold:end:$1\r"
}
travis_time_start() {
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
travis_start_time=$(travis_nanoseconds)
echo -en "travis_time:start:$travis_timer_id\r${ANSI_CLEAR}"
}
travis_time_finish() {
local result=$?
travis_end_time=$(travis_nanoseconds)
local duration=$(($travis_end_time-$travis_start_time))
echo -en "\ntravis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r${ANSI_CLEAR}"
return $result
}