blob: 65fbb12a8e8f97cb8479bcab6bd5c459efcca3d5 [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:
28 # TODO: Once merged, remove experimental tag and use latest
29 - docker pull thrift/$DISTRO:experiment || true
30 - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
31 - docker build -q -t thrift-build build/docker/$DISTRO
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090032
33script:
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090034 - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG
Roger Meier7ed94ef2015-04-26 16:55:35 +020035
henriqueac8d8e22014-07-23 23:31:04 +020036env:
Roger Meier5effab62014-11-16 22:31:33 +010037 global:
38 - TEST_NAME=""
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090039 - BUILD_CMD="none"
40 - BUILD_ARG=""
41 - BUILD_ENV="-e CC=clang -e CXX=clang++"
42 - DISTRO=ubuntu
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"
47 BUILD_CMD="../cross-test.sh"
48 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
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090051 # TODO: Remove them once migrated to CMake
52 # Autotools builds
53 - TEST_NAME="C C++ C# D Erlang Go Haxe (automake)"
54 BUILD_CMD="../autotools.sh"
55 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 +090056
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090057 - TEST_NAME="C C++ - GCC (automake)"
58 BUILD_CMD="../autotools.sh"
59 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 +090060
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090061 - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)"
62 BUILD_CMD="../autotools.sh"
63 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 +090064
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090065 # Tutorial build is unstable
66 - TEST_NAME="Dart (automake)"
67 BUILD_CMD="../autotools.sh"
68 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 +090069
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090070 # These are flaky and also have lengthy output
71 - TEST_NAME="Haskell Node.js (automake)"
72 BUILD_CMD="../autotools.sh"
73 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 +090074
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090075 # CMake build
76 - TEST_NAME="All"
77 BUILD_CMD="../cmake.sh"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090078
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090079 - TEST_NAME="C C++ - GCC"
80 BUILD_CMD="../cmake.sh"
81 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
82 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090083
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090084 - TEST_NAME="C++ (Boost Thread)"
85 BUILD_CMD="../cmake.sh"
86 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
87
88 - TEST_NAME="C++ (Boost Thread - GCC)"
89 BUILD_CMD="../cmake.sh"
90 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
91 BUILD_ENV="-e CC=gcc -e CXX=g++"
92
93 - TEST_NAME="C++ (Std Thread)"
94 BUILD_CMD="../cmake.sh"
95 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
96
97 - TEST_NAME="C++ (Std Thread - GCC)"
98 BUILD_CMD="../cmake.sh"
99 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 BUILD_ENV="-e CC=gcc -e CXX=g++"
101
102 - TEST_NAME="Compiler (mingw)"
103 BUILD_CMD="../cmake.sh"
104 BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
105 BUILD_ENV=""
106
107 - TEST_NAME="All (CentOS)"
108 BUILD_CMD="../cmake.sh"
109 DISTRO=centos
110
111 - TEST_NAME="C C++ - GCC (CentOS)"
112 BUILD_CMD="../cmake.sh"
113 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
114 BUILD_ENV="-e CC=gcc -e CXX=g++"
115 DISTRO=centos
116
117 # Distribution
118 - TEST_NAME="make dist"
119 BUILD_CMD="../make-dist.sh"
120 BUILD_ENV="-e CC=gcc -e CXX=g++"
121
122 - TEST_NAME="Debian Packages"
123 BUILD_CMD="../dpkg.sh"
124 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900125
henriqueac8d8e22014-07-23 23:31:04 +0200126matrix:
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900127 allow_failures:
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900128 - env: TEST_NAME="All (CentOS)" BUILD_CMD="../cmake.sh" DISTRO=centos
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900129
henriqueac8d8e22014-07-23 23:31:04 +0200130 include:
Roger Meier5effab62014-11-16 22:31:33 +0100131 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900132 #
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900133 # static code analysis with cppcheck
134 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900135 - env: TEST_NAME="cppcheck"
136 install:
137 - sudo apt-get update
138 - sudo apt-get install cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900139 script:
140 # Compiler cppcheck (All)
141 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
142 # C++ cppcheck (All)
143 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
144 # C Glib cppcheck (All)
145 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
146 # Silent error checks
147 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
148 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
149 - 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 +0100150
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900151 # search for TODO etc within source tree
Roger Meier5effab62014-11-16 22:31:33 +0100152 # some statistics about the code base
Roger Meier5effab62014-11-16 22:31:33 +0100153 # some info about the build machine
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900154 - env: TEST_NAME="TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900155 install:
156 - sudo apt-get update
157 - sudo apt-get install sloccount
Roger Meier5effab62014-11-16 22:31:33 +0100158 script:
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900159 - grep -r TODO *
160 - grep -r FIXME *
161 - grep -r HACK *
162 # LoC
163 - sloccount .
164 # System Info
165 - dpkg -l
166 - uname -a