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++"
|
2017-09-01 20:00:36 +00:00
|
|
|
- DISTRO=ubuntu-xenial
|
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-09-09 17:54:10 +00:00
|
|
|
- TEST_NAME="Cross Language Tests (Binary Protocol)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="cross-test.sh"
|
2017-09-09 17:54:10 +00:00
|
|
|
BUILD_ARG="-'(binary)'"
|
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
|
|
|
|
- TEST_NAME="Cross Language Tests (Header, JSON Protocols)"
|
|
|
|
SCRIPT="cross-test.sh"
|
|
|
|
BUILD_ARG="-'(header|json)'"
|
2015-11-28 06:04:39 +00:00
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
|
2017-09-01 20:00:36 +00:00
|
|
|
- TEST_NAME="Cross Language Tests (Compact and Multiplexed Protocols)"
|
2016-09-04 06:33:40 +00:00
|
|
|
SCRIPT="cross-test.sh"
|
2017-09-01 20:00:36 +00:00
|
|
|
BUILD_ARG="-'(compact|multiplexed)'"
|
2017-04-28 14:22:03 +00:00
|
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
|
2015-11-28 06:04:39 +00:00
|
|
|
# Autotools builds
|
2017-09-01 20:00:36 +00:00
|
|
|
# TODO: Remove them once migrated to CMake
|
2017-09-14 12:10:29 +00:00
|
|
|
# centos-7.3 build jobs appear to be unstable/hang...
|
|
|
|
# TEST_NAME="Autotools (CentOS 7.3)"
|
|
|
|
# DISTRO=centos-7.3
|
|
|
|
# SCRIPT="autotools.sh"
|
|
|
|
# BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
|
|
# BUILD_ARG="--without-cpp --without-csharp --without-c_glib --without-d -without-dart --without-erlang --without-go --without-haskell --without-haxe"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
2017-09-01 20:00:36 +00:00
|
|
|
- TEST_NAME="Autotools (Ubuntu Xenial)"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="autotools.sh"
|
2017-09-01 20:00:36 +00:00
|
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
2017-09-14 12:10:29 +00:00
|
|
|
BUILD_ARG="--enable-plugin" # --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-py3 --without-ruby --without-rust"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
2017-04-05 23:32:27 +00:00
|
|
|
# CMake builds
|
2017-09-14 12:10:29 +00:00
|
|
|
# centos-7.3 build jobs appear to be unstable/hang...
|
|
|
|
# TEST_NAME="CMake (CentOS 7.3)"
|
|
|
|
# DISTRO=centos-7.3
|
2015-12-10 23:04:41 +00:00
|
|
|
|
2017-09-01 20:00:36 +00:00
|
|
|
- TEST_NAME="CMake (Ubuntu Xenial)"
|
2015-11-28 06:04:39 +00:00
|
|
|
|
2017-09-01 20:00:36 +00:00
|
|
|
# C++ specific options: compiler plug-in, threading model
|
|
|
|
- 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"
|
|
|
|
|
2017-09-14 12:10:29 +00:00
|
|
|
- TEST_NAME="C++ (Std Thread) and Plugin"
|
2016-02-22 12:29:13 +00:00
|
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
2017-04-05 23:32:27 +00:00
|
|
|
BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
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
|
|
|
|
|
|
|
- TEST_NAME="Debian Packages"
|
2016-09-04 08:00:11 +00:00
|
|
|
SCRIPT="dpkg.sh"
|
2015-12-10 23:04:41 +00:00
|
|
|
|
2017-03-18 19:56:50 +00:00
|
|
|
# C and C++ undefined behavior. This wraps autotools.sh, but each binary crashes if
|
|
|
|
# undefined behavior occurs. Skips the known flaky tests.
|
|
|
|
- TEST_NAME="UBSan"
|
|
|
|
SCRIPT="ubsan.sh"
|
2017-09-14 12:10:29 +00:00
|
|
|
BUILD_ARG="--without-haskell --without-nodejs --without-perl --without-python"
|
2017-09-09 17:54:10 +00:00
|
|
|
UNSTABLE=true
|
2017-03-18 19:56:50 +00:00
|
|
|
|
2014-12-21 10:43:22 +00:00
|
|
|
matrix:
|
2017-09-09 17:54:10 +00:00
|
|
|
allow_failures:
|
|
|
|
- env: UNSTABLE=true
|
2014-12-21 10:43:22 +00:00
|
|
|
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
|