calamares/ci/travis-continuous.sh

65 lines
1.4 KiB
Bash
Raw Normal View History

#! /bin/sh
#
# Travis CI script for use on every-commit:
# - build and install Calamares
#
test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
test -n "$SRCDIR" || { echo "! \$SRCDIR not set" ; exit 1 ; }
test -d $BUILDDIR || { echo "! $BUILDDIR not a directory" ; exit 1 ; }
test -d $SRCDIR || { echo "! $SRCDIR not a directory" ; exit 1 ; }
test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
cd $BUILDDIR || exit 1
echo "###"
echo "### cmake $CMAKE_ARGS $SRCDIR"
echo "###"
cmake $CMAKE_ARGS $SRCDIR || { echo "! CMake failed" ; exit 1 ; }
echo -e "###\n### make\n###"
make -j2 || { make -j1 VERBOSE=1 ; echo "! Make failed" ; exit 1 ; }
echo -e "###\n### make install\n###"
2018-09-11 14:26:32 +02:00
install_debugging() {
ls -la $( find "$1" -type f -name '*.so' )
}
echo "# System status"
df -h
echo "# Build results"
2018-09-11 14:26:32 +02:00
install_debugging "$BUILDDIR"
echo "# Install"
DESTDIR=/build/INSTALL_ROOT
mkdir -p "$DESTDIR"
2018-09-11 14:26:32 +02:00
if make install VERBOSE=1 DESTDIR="$DESTDIR" ;
then
echo "# .. install OK"
result=true
else
echo "# .. install failed"
result=false
fi
echo "# System status"
df -h
echo "# Install results"
install_debugging "$DESTDIR"
2018-09-11 14:26:32 +02:00
2018-09-20 14:02:43 +02:00
$result || { echo "! Install failed" ; exit 1 ; } # Result of make install, above
2018-09-20 15:13:43 +02:00
echo "# Running tests"
ls -la $BUILDDIR/test_conf
chmod 755 $BUILDDIR/test_conf
2018-09-20 15:40:26 +02:00
$BUILDDIR/test_conf --help
ls -la $BUILDDIR/test_conf
2018-09-20 15:40:26 +02:00
echo "# Running ctest"
2018-09-20 15:13:43 +02:00
ctest -V