blob: 17fc71fd832496cf0a5f044442f85c61c238bbb4 [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 Sukegawa2c5ed272016-02-27 18:22:40 +090029 - travis_wait docker pull thrift/$DISTRO:latest || true
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090030 - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
Nobuaki Sukegawa2c5ed272016-02-27 18:22:40 +090031 - travis_wait travis_retry 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
Roger Meier447294f2015-12-11 00:04:41 +010051 - TEST_NAME="Cross Language Tests (Debian)"
52 BUILD_CMD="../cross-test.sh"
53 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 Sukegawaa6ab1f52015-11-28 15:04:39 +090060 BUILD_CMD="../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)"
64 BUILD_CMD="../autotools.sh"
65 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 Sukegawaf2952842016-02-27 03:29:34 +090068 - TEST_NAME="Java Lua Perl PHP Python Ruby Dart (automake)"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090069 BUILD_CMD="../autotools.sh"
Nobuaki Sukegawaf2952842016-02-27 03:29:34 +090070 BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe"
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 Sukegawaa6ab1f52015-11-28 15:04:39 +090073 - TEST_NAME="Haskell Node.js (automake)"
74 BUILD_CMD="../autotools.sh"
75 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 +090076
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090077 # CMake build
78 - TEST_NAME="All"
79 BUILD_CMD="../cmake.sh"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090080
Roger Meier447294f2015-12-11 00:04:41 +010081 - TEST_NAME="All (Debian)"
82 BUILD_CMD="../cmake.sh"
83 DISTRO=debian
84
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090085 - TEST_NAME="C C++ - GCC"
86 BUILD_CMD="../cmake.sh"
87 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
88 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090089
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090090 - TEST_NAME="C++ (Boost Thread)"
91 BUILD_CMD="../cmake.sh"
92 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
93
94 - TEST_NAME="C++ (Boost Thread - GCC)"
95 BUILD_CMD="../cmake.sh"
96 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
97 BUILD_ENV="-e CC=gcc -e CXX=g++"
98
99 - TEST_NAME="C++ (Std Thread)"
100 BUILD_CMD="../cmake.sh"
101 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
102
103 - TEST_NAME="C++ (Std Thread - GCC)"
104 BUILD_CMD="../cmake.sh"
105 BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -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="Compiler (mingw)"
109 BUILD_CMD="../cmake.sh"
110 BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
111 BUILD_ENV=""
112
113 - TEST_NAME="All (CentOS)"
114 BUILD_CMD="../cmake.sh"
115 DISTRO=centos
116
117 - TEST_NAME="C C++ - GCC (CentOS)"
118 BUILD_CMD="../cmake.sh"
119 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
120 BUILD_ENV="-e CC=gcc -e CXX=g++"
121 DISTRO=centos
122
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900123 - TEST_NAME="Python 2.6 (CentOS 6)"
124 BUILD_CMD="../cmake.sh"
125 BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
126 BUILD_ENV="-e CC=gcc -e CXX=g++"
127 DISTRO=centos6
128
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900129 # Distribution
130 - TEST_NAME="make dist"
131 BUILD_CMD="../make-dist.sh"
132 BUILD_ENV="-e CC=gcc -e CXX=g++"
133
134 - TEST_NAME="Debian Packages"
135 BUILD_CMD="../dpkg.sh"
136 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900137
Roger Meier447294f2015-12-11 00:04:41 +0100138 - TEST_NAME="make dist (Debian)"
139 BUILD_CMD="../make-dist.sh"
140 BUILD_ENV="-e CC=gcc -e CXX=g++"
141 DISTRO=debian
142
143 - TEST_NAME="Debian Packages (Debian)"
144 BUILD_CMD="../dpkg.sh"
145 BUILD_ENV="-e CC=gcc -e CXX=g++"
146 DISTRO=debian
147
henriqueac8d8e22014-07-23 23:31:04 +0200148matrix:
149 include:
Roger Meier5effab62014-11-16 22:31:33 +0100150 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900151 #
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900152 # C/C++ static code analysis with cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900153 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900154 #
155 # Python code style check with flake8
156 #
157 # search for TODO etc within source tree
158 # some statistics about the code base
159 # some info about the build machine
160 - env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900161 install:
162 - sudo apt-get update
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900163 - sudo apt-get install -y cppcheck sloccount python-flake8
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900164 script:
165 # Compiler cppcheck (All)
166 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
167 # C++ cppcheck (All)
168 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
169 # C Glib cppcheck (All)
170 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
171 # Silent error checks
172 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
173 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
174 - 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 +0900175 # Python code style
176 - flake8 --ignore=E501 lib/py
177 - flake8 tutorial/py
178 - flake8 --ignore=E501 test/py
179 - flake8 test/py.twisted
180 - flake8 test/py.tornado
181 - flake8 --ignore=E501 test/test.py
182 - flake8 --ignore=E501 test/crossrunner
183 - flake8 test/features
184 # TODO etc
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900185 - grep -r TODO *
186 - grep -r FIXME *
187 - grep -r HACK *
188 # LoC
189 - sloccount .
190 # System Info
191 - dpkg -l
192 - uname -a