aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2017-10-17 13:00:30 +0200
committerGitHub <noreply@github.com>2017-10-17 13:00:30 +0200
commitdfe3c4a1be282fe9817a1649b130c926827a0562 (patch)
treea9173003bb314323d260a01badadc683fbd3fceb
parent81aa88dc8eee9ed7573c819d96a4900b402c3456 (diff)
parente28c1e2d9e4620e343abc95f19533d285dc574a9 (diff)
Merge pull request #3763 from vespa-engine/bjorncs/travis
Bjorncs/travis
-rw-r--r--.travis.yml18
-rw-r--r--bootstrap-cmake.sh30
-rwxr-xr-xbootstrap-cpp.sh10
-rw-r--r--travis/cpp-prelude.sh7
-rw-r--r--travis/prelude.sh7
-rwxr-xr-xtravis/travis-build-cpp.sh11
-rwxr-xr-xtravis/travis-build-full.sh15
-rwxr-xr-xtravis/travis-build-install.sh14
-rwxr-xr-xtravis/travis-build-java.sh6
9 files changed, 92 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml
index 24583dca26b..20937176541 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,10 +4,6 @@ sudo: required
services:
- docker
-env:
- - PLATFORM_LANGUAGE=cpp
- - PLATFORM_LANGUAGE=java
-
cache:
timeout: 900
directories:
@@ -28,5 +24,15 @@ install: true
language: minimal
-script: ./travis/travis.sh $PLATFORM_LANGUAGE
-
+script: ./travis/travis.sh ${BUILD_TYPE}
+
+matrix:
+ include:
+ - env: BUILD_TYPE="java"
+ if: type = pull_request
+ - env: BUILD_TYPE="cpp"
+ if: type = pull_request
+ - env: BUILD_TYPE="install"
+ if: type = pull_request
+ - env: BUILD_TYPE="full"
+ if: NOT type = pull_request
diff --git a/bootstrap-cmake.sh b/bootstrap-cmake.sh
new file mode 100644
index 00000000000..c707d10a25a
--- /dev/null
+++ b/bootstrap-cmake.sh
@@ -0,0 +1,30 @@
+#!/bin/bash -e
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+usage() {
+ echo "Usage: $0 <source-dir> [<extra-cmake-args>]" >&2
+}
+
+if [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then
+ usage
+ exit 0
+elif [[ $# -eq 1 ]]; then
+ SOURCE_DIR=$1
+ EXTRA_CMAKE_ARGS=""
+elif [ $# -eq 2 ]; then
+ SOURCE_DIR=$1
+ EXTRA_CMAKE_ARGS=$2
+else
+ echo "Wrong number of arguments: expected 1 or 2, was $#" >&2
+ usage
+ exit 1
+fi
+
+cmake3 \
+ -DCMAKE_INSTALL_PREFIX=/opt/vespa \
+ -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
+ -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \
+ -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \
+ -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \
+ ${EXTRA_CMAKE_ARGS} \
+ "${SOURCE_DIR}"
diff --git a/bootstrap-cpp.sh b/bootstrap-cpp.sh
index aef18a9a020..6495bf0177c 100755
--- a/bootstrap-cpp.sh
+++ b/bootstrap-cpp.sh
@@ -19,14 +19,8 @@ fi
mkdir -p "${BUILD_DIR}"
-source /opt/rh/devtoolset-6/enable || true
+source /etc/profile.d/devtoolset-6.sh || true
cd "${SOURCE_DIR}"
sh ./bootstrap.sh full
cd "${BUILD_DIR}"
-cmake3 \
- -DCMAKE_INSTALL_PREFIX=/opt/vespa \
- -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
- -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \
- -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \
- -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \
- "${SOURCE_DIR}"
+sh ${SOURCE_DIR}/bootstrap-cmake.sh ${SOURCE_DIR}
diff --git a/travis/cpp-prelude.sh b/travis/cpp-prelude.sh
new file mode 100644
index 00000000000..2cb7633d3d7
--- /dev/null
+++ b/travis/cpp-prelude.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+export CCACHE_MAXSIZE="1250M"
+export CCACHE_COMPRESS=1
+ccache --print-config
diff --git a/travis/prelude.sh b/travis/prelude.sh
new file mode 100644
index 00000000000..c3467bff05f
--- /dev/null
+++ b/travis/prelude.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+export SOURCE_DIR=/source
+export NUM_THREADS=4
+source /etc/profile.d/devtoolset-6.sh || true
diff --git a/travis/travis-build-cpp.sh b/travis/travis-build-cpp.sh
index bc2b564d13f..d5ac94fa6b9 100755
--- a/travis/travis-build-cpp.sh
+++ b/travis/travis-build-cpp.sh
@@ -2,17 +2,12 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
-SOURCE_DIR=/source
-BUILD_DIR=~/build
+source /source/travis/prelude.sh
+source ${SOURCE_DIR}/travis/cpp-prelude.sh
+BUILD_DIR=~/build
mkdir "${BUILD_DIR}"
-export CCACHE_MAXSIZE="1250M"
-export CCACHE_COMPRESS=1
-NUM_THREADS=4
-ccache --print-config
-source /etc/profile.d/devtoolset-6.sh || true
-
cd ${BUILD_DIR}
bash ${SOURCE_DIR}/bootstrap-cpp.sh ${SOURCE_DIR} ${BUILD_DIR}
make -j ${NUM_THREADS}
diff --git a/travis/travis-build-full.sh b/travis/travis-build-full.sh
new file mode 100755
index 00000000000..7ee9a1c065f
--- /dev/null
+++ b/travis/travis-build-full.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+source /source/travis/prelude.sh
+source ${SOURCE_DIR}/travis/cpp-prelude.sh
+
+cd ${SOURCE_DIR}
+sh ./bootstrap.sh java
+mvn install --no-snapshot-updates --batch-mode --threads ${NUM_THREADS}
+bash ${SOURCE_DIR}/bootstrap-cmake.sh ${SOURCE_DIR}
+make -j ${NUM_THREADS}
+ctest3 --output-on-failure -j ${NUM_THREADS}
+ccache --show-stats
+make install
diff --git a/travis/travis-build-install.sh b/travis/travis-build-install.sh
new file mode 100755
index 00000000000..6469a346045
--- /dev/null
+++ b/travis/travis-build-install.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+source /source/travis/prelude.sh
+source ${SOURCE_DIR}/travis/cpp-prelude.sh
+
+cd ${SOURCE_DIR}
+sh ./bootstrap.sh java
+mvn install --no-snapshot-updates --batch-mode --threads ${NUM_THREADS} --quiet\
+ -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true
+bash ${SOURCE_DIR}/bootstrap-cmake.sh ${SOURCE_DIR} "-DEXCLUDE_TESTS_FROM_ALL=TRUE"
+make -j ${NUM_THREADS}
+make install
diff --git a/travis/travis-build-java.sh b/travis/travis-build-java.sh
index 0a69e167dba..37a61d19f69 100755
--- a/travis/travis-build-java.sh
+++ b/travis/travis-build-java.sh
@@ -2,11 +2,9 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
-SOURCE_DIR=/source
-NUM_THREADS=4
+source /source/travis/prelude.sh
cd "${SOURCE_DIR}"
export MAVEN_OPTS="-Xms128m -Xmx1g"
-source /etc/profile.d/devtoolset-6.sh || true
sh ./bootstrap.sh java
-mvn install -nsu -B -T ${NUM_THREADS} -V # Should ideally split out test phase, but some unit tests fails on 'mvn test'
+mvn install --no-snapshot-updates --batch-mode --threads ${NUM_THREADS}