blob: 3b2ed457cc373d09dc1f29f12d7e4375ab035594 [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
23
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090024services:
25 - docker
Roger Meiera0836f62013-05-05 00:19:38 +020026
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090027install:
Nobuaki Sukegawa0156aae2015-12-09 23:21:29 +090028 - docker pull thrift/$DISTRO:latest || true
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090029 - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
30 - docker build -q -t thrift-build build/docker/$DISTRO
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090031
32script:
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090033 - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $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 Sukegawaa6ab1f52015-11-28 15:04:39 +090038 - BUILD_CMD="none"
39 - BUILD_ARG=""
40 - BUILD_ENV="-e CC=clang -e CXX=clang++"
41 - DISTRO=ubuntu
henriquec0a7d722014-07-26 13:11:12 +020042
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090043 matrix:
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090044 # TODO: Break up by protocol types to avoid 50min limit
45 - TEST_NAME="Cross Language Tests"
46 BUILD_CMD="../cross-test.sh"
47 BUILD_ARG="--enable-tutorial=no"
48 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Roger Meier41ad4342015-03-24 22:30:40 +010049
Roger Meier447294f2015-12-11 00:04:41 +010050 - TEST_NAME="Cross Language Tests (Debian)"
51 BUILD_CMD="../cross-test.sh"
52 BUILD_ARG="--enable-tutorial=no"
53 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
54 DISTRO=debian
55
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090056 # TODO: Remove them once migrated to CMake
57 # Autotools builds
Nobuaki Sukegawa2eed6862016-02-01 19:45:07 +090058 - TEST_NAME="C C++ C# D Erlang Haxe (automake)"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090059 BUILD_CMD="../autotools.sh"
Nobuaki Sukegawa2eed6862016-02-01 19:45:07 +090060 BUILD_ARG="--without-go --without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
61
62 # Temporarily isolate Go as it hangs on make check
63 # TODO: Merge with above group once fixed
64 - TEST_NAME="Go (automake)"
65 BUILD_CMD="../autotools.sh"
66 BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-haxe --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 +090067
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090068 - TEST_NAME="C C++ - GCC (automake)"
69 BUILD_CMD="../autotools.sh"
70 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 Sukegawae58ed1a2015-11-23 19:23:43 +090071
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090072 - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)"
73 BUILD_CMD="../autotools.sh"
74 BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090075
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090076 # Tutorial build is unstable
77 - TEST_NAME="Dart (automake)"
78 BUILD_CMD="../autotools.sh"
79 BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --enable-tutorial=no"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090080
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090081 # These are flaky and also have lengthy output
82 - TEST_NAME="Haskell Node.js (automake)"
83 BUILD_CMD="../autotools.sh"
84 BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-perl --without-php --without-php_extension --without-python --without-ruby"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090085
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090086 # CMake build
87 - TEST_NAME="All"
88 BUILD_CMD="../cmake.sh"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090089
Roger Meier447294f2015-12-11 00:04:41 +010090 - TEST_NAME="All (Debian)"
91 BUILD_CMD="../cmake.sh"
92 DISTRO=debian
93
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090094 - TEST_NAME="C C++ - GCC"
95 BUILD_CMD="../cmake.sh"
96 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
97 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090098
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090099 - TEST_NAME="C++ (Boost Thread)"
100 BUILD_CMD="../cmake.sh"
101 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
102
103 - TEST_NAME="C++ (Boost Thread - GCC)"
104 BUILD_CMD="../cmake.sh"
105 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
106 BUILD_ENV="-e CC=gcc -e CXX=g++"
107
108 - TEST_NAME="C++ (Std Thread)"
109 BUILD_CMD="../cmake.sh"
110 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
111
112 - TEST_NAME="C++ (Std Thread - GCC)"
113 BUILD_CMD="../cmake.sh"
114 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
115 BUILD_ENV="-e CC=gcc -e CXX=g++"
116
117 - TEST_NAME="Compiler (mingw)"
118 BUILD_CMD="../cmake.sh"
119 BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
120 BUILD_ENV=""
121
122 - TEST_NAME="All (CentOS)"
123 BUILD_CMD="../cmake.sh"
124 DISTRO=centos
125
126 - TEST_NAME="C C++ - GCC (CentOS)"
127 BUILD_CMD="../cmake.sh"
128 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
129 BUILD_ENV="-e CC=gcc -e CXX=g++"
130 DISTRO=centos
131
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900132 - TEST_NAME="Python 2.6 (CentOS 6)"
133 BUILD_CMD="../cmake.sh"
134 BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
135 BUILD_ENV="-e CC=gcc -e CXX=g++"
136 DISTRO=centos6
137
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900138 # Distribution
139 - TEST_NAME="make dist"
140 BUILD_CMD="../make-dist.sh"
141 BUILD_ENV="-e CC=gcc -e CXX=g++"
142
143 - TEST_NAME="Debian Packages"
144 BUILD_CMD="../dpkg.sh"
145 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900146
Roger Meier447294f2015-12-11 00:04:41 +0100147 - TEST_NAME="make dist (Debian)"
148 BUILD_CMD="../make-dist.sh"
149 BUILD_ENV="-e CC=gcc -e CXX=g++"
150 DISTRO=debian
151
152 - TEST_NAME="Debian Packages (Debian)"
153 BUILD_CMD="../dpkg.sh"
154 BUILD_ENV="-e CC=gcc -e CXX=g++"
155 DISTRO=debian
156
henriqueac8d8e22014-07-23 23:31:04 +0200157matrix:
Nobuaki Sukegawa2eed6862016-02-01 19:45:07 +0900158 allow_failures:
159 - env: TEST_NAME="Go (automake)" BUILD_CMD="../autotools.sh" BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-haxe --without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
160
henriqueac8d8e22014-07-23 23:31:04 +0200161 include:
Roger Meier5effab62014-11-16 22:31:33 +0100162 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900163 #
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900164 # static code analysis with cppcheck
165 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900166 - env: TEST_NAME="cppcheck"
167 install:
168 - sudo apt-get update
169 - sudo apt-get install cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900170 script:
171 # Compiler cppcheck (All)
172 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
173 # C++ cppcheck (All)
174 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
175 # C Glib cppcheck (All)
176 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
177 # Silent error checks
178 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
179 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
180 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
Roger Meier5effab62014-11-16 22:31:33 +0100181
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900182 # search for TODO etc within source tree
Roger Meier5effab62014-11-16 22:31:33 +0100183 # some statistics about the code base
Roger Meier5effab62014-11-16 22:31:33 +0100184 # some info about the build machine
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900185 - env: TEST_NAME="TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900186 install:
187 - sudo apt-get update
188 - sudo apt-get install sloccount
Roger Meier5effab62014-11-16 22:31:33 +0100189 script:
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900190 - grep -r TODO *
191 - grep -r FIXME *
192 - grep -r HACK *
193 # LoC
194 - sloccount .
195 # System Info
196 - dpkg -l
197 - uname -a