aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-07-12 23:30:29 +0200
committerSimon Warta <[email protected]>2015-07-12 23:30:29 +0200
commit098f193e34cf96d88e6f1bfbe53b4ce2464929f1 (patch)
tree09561b93e0bd3fae090036b03467e049916843f2
parent5192a64c7791b1b9fca16d38cf05d6c7564fcd99 (diff)
parent8b8bb221b578cbb25f33b6c3a2db89240a1f6980 (diff)
Merge pull request #191 from webmaster128/test-travis-containers
Test travis container infrastructure
-rw-r--r--.travis.yml18
-rwxr-xr-xsrc/scripts/ci/after_success.sh14
-rwxr-xr-xsrc/scripts/ci/build.sh20
-rwxr-xr-xsrc/scripts/ci/install.sh11
-rwxr-xr-xsrc/scripts/ci/setup.sh23
5 files changed, 52 insertions, 34 deletions
diff --git a/.travis.yml b/.travis.yml
index 038334c75..15ae33168 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,5 @@
language: cpp
-sudo: required
-
# BEGIN BUILD MATRIX
#
# Build matrix must be smaller on branch coverity_scan because quota allows
@@ -48,8 +46,12 @@ matrix:
env: MODULES="min" BUILD_MODE="static"
# END BUILD MATRIX
+cache:
+ directories:
+ - $HOME/.ccache
+
install:
- - ./src/scripts/ci/setup.sh
+ - ./src/scripts/ci/install.sh
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./src/scripts/ci/build.sh ; fi
@@ -61,6 +63,16 @@ notifications:
addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - ccache
+ - g++-4.8
+ - libssl-dev
+ - libsqlite3-dev
+ - zlib1g-dev
+
coverity_scan:
project:
name: "randombit/botan"
diff --git a/src/scripts/ci/after_success.sh b/src/scripts/ci/after_success.sh
index 9ac4a2b51..76e16e05b 100755
--- a/src/scripts/ci/after_success.sh
+++ b/src/scripts/ci/after_success.sh
@@ -3,11 +3,11 @@
set -ev
if [ "$BUILD_MODE" = "coverage" ]; then
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info
- lcov --list coverage.info
- # Assume that $COVERALLS_REPO_TOKEN might not be set (e.g. pull requests)
- coveralls-lcov --repo-token="$COVERALLS_REPO_TOKEN" coverage.info
-fi
+ GCOV="/usr/bin/gcov-4.8"
+ /tmp/usr/bin/lcov --gcov-tool "$GCOV" --directory . --capture --output-file coverage.info
+ /tmp/usr/bin/lcov --gcov-tool "$GCOV" --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info
+ /tmp/usr/bin/lcov --gcov-tool "$GCOV" --list coverage.info
-sudo make install
+ # Assume that $COVERALLS_REPO_TOKEN might not be set (e.g. pull requests)
+ coveralls-lcov --repo-token="$COVERALLS_REPO_TOKEN" coverage.info
+fi
diff --git a/src/scripts/ci/build.sh b/src/scripts/ci/build.sh
index 684cca437..9bb7ce7e6 100755
--- a/src/scripts/ci/build.sh
+++ b/src/scripts/ci/build.sh
@@ -17,10 +17,28 @@ if [ "$MODULES" = "min" ]; then
CFG_FLAGS="$CFG_FLAGS --no-autoload --enable-modules=base"
fi
+# Workaround for missing update-alternatives
+# https://github.com/travis-ci/travis-ci/issues/3668
+if [ "$CXX" = "g++" ]; then
+ export CXX="/usr/bin/g++-4.8"
+fi
+
+#enable ccache
+if [ "$TRAVIS_OS_NAME" = "linux" ]; then
+ ccache --max-size=30M
+ ccache --show-stats
+
+ export CXX="ccache $CXX"
+fi
+
$CXX --version
-python configure.py $CFG_FLAGS --cc=$CC --cc-bin=$CXX --with-openssl --with-sqlite --with-zlib
+./configure.py $CFG_FLAGS --cc="$CC" --cc-bin="$CXX" \
+ --with-openssl --with-sqlite --with-zlib \
+ --prefix=/tmp/botan-installation
make -j 2
if [ "$MODULES" != "min" ]; then
./botan-test
fi
+
+make install
diff --git a/src/scripts/ci/install.sh b/src/scripts/ci/install.sh
new file mode 100755
index 000000000..dd9b7e371
--- /dev/null
+++ b/src/scripts/ci/install.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -ev
+
+if [ "$BUILD_MODE" = "coverage" ]; then
+ wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
+ tar -xvf lcov_1.11.orig.tar.gz
+ export PREFIX="/tmp"
+ make -C lcov-1.11/ install
+ gem install coveralls-lcov
+fi
diff --git a/src/scripts/ci/setup.sh b/src/scripts/ci/setup.sh
deleted file mode 100755
index 97019fd57..000000000
--- a/src/scripts/ci/setup.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-set -ev
-
-if [ "$TRAVIS_OS_NAME" = "linux" ]; then
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
-
- sudo apt-get install -y g++-4.8
- sudo apt-get install -y libssl-dev
- sudo apt-get install -y libz-dev
- sudo apt-get install -y libsqlite3-dev
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 90
-fi
-
-if [ "$BUILD_MODE" = "coverage" ]; then
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
- tar -xvf lcov_1.11.orig.tar.gz
- sudo make -C lcov-1.11/ install
- gem install coveralls-lcov
-fi