2013-05-04 22:19:38 +00:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
# build Apache Thrift on Travis CI - https://travis-ci.org/
|
|
|
|
|
2015-06-26 10:56:18 +00:00
|
|
|
sudo: required
|
2016-02-28 02:28:19 +00:00
|
|
|
dist: trusty
|
2015-06-26 10:56:18 +00:00
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
services:
|
|
|
|
- docker
|
2014-12-21 10:43:22 +00:00
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
install:
|
2016-09-04 08:00:11 +00:00
|
|
|
- (travis_wait ./build/docker/check_unmodified.sh $DISTRO && touch .unmodified) || true
|
|
|
|
- if [ ! -f .unmodified ]; then travis_retry travis_wait docker build -q -t thrift-build:$DISTRO build/docker/$DISTRO; fi
|
2014-12-21 10:43:22 +00:00
|
|
|
|
|
|
|
script:
|
2016-09-04 08:00:11 +00:00
|
|
|
- docker run --net=host -e BUILD_LIBS="$BUILD_LIBS" $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build:$DISTRO build/docker/scripts/$SCRIPT $BUILD_ARG
|
2015-04-26 14:55:35 +00:00
|
|
|
|
2014-11-16 21:31:33 +00:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- TEST_NAME=""
|
2016-09-04 08:00:11 +00:00
|
|
|
- SCRIPT="cmake.sh"
|
2015-11-28 06:04:39 +00:00
|
|
|
- BUILD_ARG=""
|
|
|
|
- BUILD_ENV="-e CC=clang -e CXX=clang++"
|
|
|
|
- DISTRO=ubuntu
|
2016-02-22 12:29:13 +00:00
|
|
|
- BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
|
2014-07-23 21:31:04 +00:00
|
|
|
|
2014-12-21 10:43:22 +00:00
|
|
|
matrix:
|
2017-02-18 18:55:30 +00:00
|
|
|
- TEST_NAME="Cross Language Tests (Binary, Header, Multiplexed Protocols)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="cross-test.sh"
|
2017-02-18 18:55:30 +00:00
|
|
|
BUILD_ARG="-'(binary|header|multiplexed)'"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
|
2017-02-18 18:55:30 +00:00
|
|
|
- TEST_NAME="Cross Language Tests (Debian) (Binary, Header, Multiplexed Protocols)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="cross-test.sh"
|
2017-02-18 18:55:30 +00:00
|
|
|
BUILD_ARG="-'(binary|header|multiplexed)'"
|
2016-09-04 06:33:40 +00:00
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
DISTRO=debian
|
|
|
|
|
|
|
|
- TEST_NAME="Cross Language Tests (Compact and JSON Protocols)"
|
|
|
|
SCRIPT="cross-test.sh"
|
|
|
|
BUILD_ARG="-'(compact|json)'"
|
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
|
|
|
|
- TEST_NAME="Cross Language Tests (Debian) (Compact and JSON Protocols)"
|
|
|
|
SCRIPT="cross-test.sh"
|
|
|
|
BUILD_ARG="-'(compact|json)'"
|
2015-12-10 23:04:41 +00:00
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
DISTRO=debian
|
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
# TODO: Remove them once migrated to CMake
|
|
|
|
# Autotools builds
|
2016-02-04 05:27:24 +00:00
|
|
|
- TEST_NAME="C C++ C# D Erlang Haxe Go (automake)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="autotools.sh"
|
2016-02-04 05:27:24 +00:00
|
|
|
BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
|
|
|
- TEST_NAME="C C++ - GCC (automake)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="autotools.sh"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-dart --without-ruby --without-haskell --without-go --without-haxe --without-d"
|
2016-02-14 12:56:53 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
2016-06-12 07:12:30 +00:00
|
|
|
- TEST_NAME="Java Lua PHP Ruby Dart (automake)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="autotools.sh"
|
2016-06-12 07:12:30 +00:00
|
|
|
BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-nodejs --without-python --without-perl"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
2016-02-26 18:29:34 +00:00
|
|
|
# These are flaky (due to cabal and npm network/server failures) and also have lengthy output
|
2016-06-12 07:12:30 +00:00
|
|
|
- TEST_NAME="Haskell Node.js Python Perl (automake)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="autotools.sh"
|
2016-06-12 07:12:30 +00:00
|
|
|
BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-php --without-php_extension --without-ruby"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
|
|
|
# CMake build
|
|
|
|
- TEST_NAME="All"
|
|
|
|
|
2015-12-10 23:04:41 +00:00
|
|
|
- TEST_NAME="All (Debian)"
|
|
|
|
DISTRO=debian
|
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
- TEST_NAME="C C++ - GCC"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
|
|
|
|
- TEST_NAME="C++ (Boost Thread)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
|
|
|
|
- TEST_NAME="C++ (Boost Thread - GCC)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
|
|
|
|
- TEST_NAME="C++ (Std Thread)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
|
|
|
|
- TEST_NAME="C++ (Std Thread - GCC)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
|
|
|
|
- TEST_NAME="Compiler (mingw)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS=""
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
|
|
|
|
BUILD_ENV=""
|
|
|
|
|
2016-02-28 04:47:44 +00:00
|
|
|
- TEST_NAME="All - GCC (CentOS)"
|
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
2015-11-28 06:04:39 +00:00
|
|
|
DISTRO=centos
|
|
|
|
|
2016-02-28 04:47:44 +00:00
|
|
|
- TEST_NAME="C C++ - Clang (CentOS)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
DISTRO=centos
|
|
|
|
|
2016-01-03 05:24:39 +00:00
|
|
|
- TEST_NAME="Python 2.6 (CentOS 6)"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="PYTHON TESTING TUTORIALS"
|
2016-01-03 05:24:39 +00:00
|
|
|
BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
DISTRO=centos6
|
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
# Distribution
|
|
|
|
- TEST_NAME="make dist"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="make-dist.sh"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
|
|
|
|
- TEST_NAME="Debian Packages"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="dpkg.sh"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
2015-11-23 10:23:43 +00:00
|
|
|
|
2015-12-10 23:04:41 +00:00
|
|
|
- TEST_NAME="make dist (Debian)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="make-dist.sh"
|
2015-12-10 23:04:41 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
DISTRO=debian
|
|
|
|
|
|
|
|
- TEST_NAME="Debian Packages (Debian)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="dpkg.sh"
|
2015-12-10 23:04:41 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
DISTRO=debian
|
|
|
|
|
2014-12-21 10:43:22 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2014-11-16 21:31:33 +00:00
|
|
|
# QA jobs for code analytics and metrics
|
2015-11-28 06:04:39 +00:00
|
|
|
#
|
2016-02-28 02:28:19 +00:00
|
|
|
# C/C++ static code analysis with cppcheck
|
2015-11-23 10:23:43 +00:00
|
|
|
# add --error-exitcode=1 to --enable=all as soon as everything is fixed
|
2016-02-28 02:28:19 +00:00
|
|
|
#
|
|
|
|
# Python code style check with flake8
|
|
|
|
#
|
|
|
|
# search for TODO etc within source tree
|
|
|
|
# some statistics about the code base
|
|
|
|
# some info about the build machine
|
|
|
|
- env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
|
2015-11-28 06:04:39 +00:00
|
|
|
install:
|
2016-02-29 16:26:56 +00:00
|
|
|
- travis_retry sudo apt-get update
|
|
|
|
- travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8
|
2015-11-23 10:23:43 +00:00
|
|
|
script:
|
|
|
|
# Compiler cppcheck (All)
|
|
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
|
|
|
|
# C++ cppcheck (All)
|
|
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
|
|
|
|
# C Glib cppcheck (All)
|
|
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
|
|
|
|
# Silent error checks
|
|
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
|
|
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
|
|
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
|
2016-02-28 02:28:19 +00:00
|
|
|
# Python code style
|
|
|
|
- flake8 --ignore=E501 lib/py
|
|
|
|
- flake8 tutorial/py
|
|
|
|
- flake8 --ignore=E501 test/py
|
|
|
|
- flake8 test/py.twisted
|
|
|
|
- flake8 test/py.tornado
|
|
|
|
- flake8 --ignore=E501 test/test.py
|
|
|
|
- flake8 --ignore=E501 test/crossrunner
|
|
|
|
- flake8 test/features
|
|
|
|
# TODO etc
|
2015-11-23 10:23:43 +00:00
|
|
|
- grep -r TODO *
|
|
|
|
- grep -r FIXME *
|
|
|
|
- grep -r HACK *
|
|
|
|
# LoC
|
|
|
|
- sloccount .
|
|
|
|
# System Info
|
|
|
|
- dpkg -l
|
|
|
|
- uname -a
|