blob: fc5f9533126a6a982062081113d6b661ab04577c [file] [log] [blame]
Roger Meiera0836f62013-05-05 00:19:38 +02001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20# build Apache Thrift on Travis CI - https://travis-ci.org/
21
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100022sudo: required
Nobuaki Sukegawad479e232016-02-28 11:28:19 +090023dist: trusty
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100024
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090025services:
26 - docker
Roger Meiera0836f62013-05-05 00:19:38 +020027
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090028install:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090029 - (travis_wait ./build/docker/check_unmodified.sh $DISTRO && touch .unmodified) || true
30 - if [ ! -f .unmodified ]; then travis_retry travis_wait docker build -q -t thrift-build:$DISTRO build/docker/$DISTRO; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090031
32script:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090033 - 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
Roger Meier7ed94ef2015-04-26 16:55:35 +020034
henriqueac8d8e22014-07-23 23:31:04 +020035env:
Roger Meier5effab62014-11-16 22:31:33 +010036 global:
37 - TEST_NAME=""
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090038 - SCRIPT="cmake.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090039 - BUILD_ARG=""
40 - BUILD_ENV="-e CC=clang -e CXX=clang++"
41 - DISTRO=ubuntu
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090042 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
henriquec0a7d722014-07-26 13:11:12 +020043
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090044 matrix:
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090045 # TODO: Break up by protocol types to avoid 50min limit
46 - TEST_NAME="Cross Language Tests"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090047 SCRIPT="cross-test.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090048 BUILD_ARG="--enable-tutorial=no"
49 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Roger Meier41ad4342015-03-24 22:30:40 +010050
Roger Meier447294f2015-12-11 00:04:41 +010051 - TEST_NAME="Cross Language Tests (Debian)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090052 SCRIPT="cross-test.sh"
Roger Meier447294f2015-12-11 00:04:41 +010053 BUILD_ARG="--enable-tutorial=no"
54 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
55 DISTRO=debian
56
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090057 # TODO: Remove them once migrated to CMake
58 # Autotools builds
Nobuaki Sukegawa5b446122016-02-04 14:27:24 +090059 - TEST_NAME="C C++ C# D Erlang Haxe Go (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090060 SCRIPT="autotools.sh"
Nobuaki Sukegawa5b446122016-02-04 14:27:24 +090061 BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090062
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090063 - TEST_NAME="C C++ - GCC (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090064 SCRIPT="autotools.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090065 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"
Nobuaki Sukegawaea5845a2016-02-14 21:56:53 +090066 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090067
Nobuaki Sukegawaa52ea352016-06-12 16:12:30 +090068 - TEST_NAME="Java Lua PHP Ruby Dart (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090069 SCRIPT="autotools.sh"
Nobuaki Sukegawaa52ea352016-06-12 16:12:30 +090070 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"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090071
Nobuaki Sukegawaf2952842016-02-27 03:29:34 +090072 # These are flaky (due to cabal and npm network/server failures) and also have lengthy output
Nobuaki Sukegawaa52ea352016-06-12 16:12:30 +090073 - TEST_NAME="Haskell Node.js Python Perl (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090074 SCRIPT="autotools.sh"
Nobuaki Sukegawaa52ea352016-06-12 16:12:30 +090075 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"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090076
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090077 # CMake build
78 - TEST_NAME="All"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090079
Roger Meier447294f2015-12-11 00:04:41 +010080 - TEST_NAME="All (Debian)"
Roger Meier447294f2015-12-11 00:04:41 +010081 DISTRO=debian
82
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090083 - TEST_NAME="C C++ - GCC"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090084 BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090085 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
86 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090087
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090088 - TEST_NAME="C++ (Boost Thread)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090089 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090090 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
91
92 - TEST_NAME="C++ (Boost Thread - GCC)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090093 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090094 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
95 BUILD_ENV="-e CC=gcc -e CXX=g++"
96
97 - TEST_NAME="C++ (Std Thread)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090098 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090099 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
100
101 - TEST_NAME="C++ (Std Thread - GCC)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900102 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900103 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
104 BUILD_ENV="-e CC=gcc -e CXX=g++"
105
106 - TEST_NAME="Compiler (mingw)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900107 BUILD_LIBS=""
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900108 BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
109 BUILD_ENV=""
110
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +0900111 - TEST_NAME="All - GCC (CentOS)"
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +0900112 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900113 DISTRO=centos
114
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +0900115 - TEST_NAME="C C++ - Clang (CentOS)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900116 BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900117 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900118 DISTRO=centos
119
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900120 - TEST_NAME="Python 2.6 (CentOS 6)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900121 BUILD_LIBS="PYTHON TESTING TUTORIALS"
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900122 BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
123 BUILD_ENV="-e CC=gcc -e CXX=g++"
124 DISTRO=centos6
125
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900126 # Distribution
127 - TEST_NAME="make dist"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900128 SCRIPT="make-dist.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900129 BUILD_ENV="-e CC=gcc -e CXX=g++"
130
131 - TEST_NAME="Debian Packages"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900132 SCRIPT="dpkg.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900133 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900134
Roger Meier447294f2015-12-11 00:04:41 +0100135 - TEST_NAME="make dist (Debian)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900136 SCRIPT="make-dist.sh"
Roger Meier447294f2015-12-11 00:04:41 +0100137 BUILD_ENV="-e CC=gcc -e CXX=g++"
138 DISTRO=debian
139
140 - TEST_NAME="Debian Packages (Debian)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900141 SCRIPT="dpkg.sh"
Roger Meier447294f2015-12-11 00:04:41 +0100142 BUILD_ENV="-e CC=gcc -e CXX=g++"
143 DISTRO=debian
144
henriqueac8d8e22014-07-23 23:31:04 +0200145matrix:
146 include:
Roger Meier5effab62014-11-16 22:31:33 +0100147 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900148 #
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900149 # C/C++ static code analysis with cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900150 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900151 #
152 # Python code style check with flake8
153 #
154 # search for TODO etc within source tree
155 # some statistics about the code base
156 # some info about the build machine
157 - env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900158 install:
Nobuaki Sukegawa3dd4d8e2016-03-01 01:26:56 +0900159 - travis_retry sudo apt-get update
160 - travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900161 script:
162 # Compiler cppcheck (All)
163 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
164 # C++ cppcheck (All)
165 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
166 # C Glib cppcheck (All)
167 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
168 # Silent error checks
169 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
170 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
171 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900172 # Python code style
173 - flake8 --ignore=E501 lib/py
174 - flake8 tutorial/py
175 - flake8 --ignore=E501 test/py
176 - flake8 test/py.twisted
177 - flake8 test/py.tornado
178 - flake8 --ignore=E501 test/test.py
179 - flake8 --ignore=E501 test/crossrunner
180 - flake8 test/features
181 # TODO etc
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900182 - grep -r TODO *
183 - grep -r FIXME *
184 - grep -r HACK *
185 # LoC
186 - sloccount .
187 # System Info
188 - dpkg -l
189 - uname -a