diff options
-rw-r--r-- | .travis.yml | 26 | ||||
-rwxr-xr-x | travis/travis-build-cpp.sh | 27 | ||||
-rwxr-xr-x | travis/travis-build-java.sh | 12 | ||||
-rwxr-xr-x | travis/travis.sh | 9 |
4 files changed, 74 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..6fdb89af4e0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +sudo: required + +services: + - docker + +env: + - PLATFORM_LANGUAGE=cpp + - PLATFORM_LANGUAGE=java + +cache: + timeout: 900 + directories: + - $HOME/.m2 + - $HOME/.ccache + +before_cache: + - rm -rf /root/.m2/repository/com/yahoo + - rm -rf /root/.m2/repository/simple/dummy-persistence + +install: true + +language: generic + +script: sh ./travis/travis.sh $PLATFORM_LANGUAGE + diff --git a/travis/travis-build-cpp.sh b/travis/travis-build-cpp.sh new file mode 100755 index 00000000000..27d35fa3518 --- /dev/null +++ b/travis/travis-build-cpp.sh @@ -0,0 +1,27 @@ +#!/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_DIR=/source +BUILD_DIR=~/build + +mkdir "${BUILD_DIR}" + +ccache -M 20G +NUM_THREADS=4 +source /opt/rh/devtoolset-6/enable || 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" \ + -DCMAKE_BUILD_RPATH=/opt/vespa/lib64 \ + -DVALGRIND_UNIT_TESTS=no \ + "${SOURCE_DIR}" +make -j ${NUM_THREADS} +ctest3 -j ${NUM_THREADS} + diff --git a/travis/travis-build-java.sh b/travis/travis-build-java.sh new file mode 100755 index 00000000000..7e0088586a4 --- /dev/null +++ b/travis/travis-build-java.sh @@ -0,0 +1,12 @@ +#!/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_DIR=/source +NUM_THREADS=4 + +cd "${SOURCE_DIR}" +source /opt/rh/devtoolset-6/enable || true +export MAVEN_OPTS="-Xms128m -Xmx512m" +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' diff --git a/travis/travis.sh b/travis/travis.sh new file mode 100755 index 00000000000..f64affbcbb0 --- /dev/null +++ b/travis/travis.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +set -e + +PLATFORM_LANGUAGE=$1 +DOCKER_IMAGE=vespaengine/vespa-dev:latest +docker run --rm -v ${HOME}/.m2:/root/.m2 -v ${HOME}/.ccache:/root/.ccache -v $(pwd):/source \ + --entrypoint /source/travis/travis-build-${PLATFORM_LANGUAGE}.sh ${DOCKER_IMAGE} + |