blob: 6b0b9afd52c86b0364d3d67ef8f948f955cdc632 [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:
Allen Georgebc1344d2017-04-28 10:22:03 -040045 - TEST_NAME="Cross Language Tests (Header, Multiplexed and JSON Protocols)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090046 SCRIPT="cross-test.sh"
Allen Georgebc1344d2017-04-28 10:22:03 -040047 BUILD_ARG="-'(header|multiplexed|json)'"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090048 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Roger Meier41ad4342015-03-24 22:30:40 +010049
Allen Georgebc1344d2017-04-28 10:22:03 -040050 - TEST_NAME="Cross Language Tests (Binary Protocol)"
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090051 SCRIPT="cross-test.sh"
Allen Georgebc1344d2017-04-28 10:22:03 -040052 BUILD_ARG="-'(binary)'"
53 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
54
55 - TEST_NAME="Cross Language Tests (Compact Protocol)"
56 SCRIPT="cross-test.sh"
57 BUILD_ARG="-'(compact)'"
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090058 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
59
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090060 # TODO: Remove them once migrated to CMake
61 # Autotools builds
Nobuaki Sukegawa5b446122016-02-04 14:27:24 +090062 - TEST_NAME="C C++ C# D Erlang Haxe Go (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090063 SCRIPT="autotools.sh"
Allen Georgebc1344d2017-04-28 10:22:03 -040064 BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --without-rust"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090065
James E. King, IIIee17ff92017-04-07 00:25:42 -040066 - TEST_NAME="C C++ Plugin Haskell Perl - GCC (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090067 SCRIPT="autotools.sh"
Allen Georgebc1344d2017-04-28 10:22:03 -040068 BUILD_ARG="--enable-plugin --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 --without-rust"
Nobuaki Sukegawaea5845a2016-02-14 21:56:53 +090069 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090070
Allen Georgebc1344d2017-04-28 10:22:03 -040071 - TEST_NAME="Java Lua PHP Ruby Dart Node.js Python Rust (automake)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090072 SCRIPT="autotools.sh"
James E. King, III4eb23472017-04-05 19:32:27 -040073 BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090074
James E. King, III4eb23472017-04-05 19:32:27 -040075 # CMake builds
Roger Meier447294f2015-12-11 00:04:41 +010076 - TEST_NAME="All (Debian)"
Roger Meier447294f2015-12-11 00:04:41 +010077 DISTRO=debian
78
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090079 - TEST_NAME="C C++ - GCC"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090080 BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090081 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 - GCC)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090085 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090086 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
87 BUILD_ENV="-e CC=gcc -e CXX=g++"
88
James E. King, III4eb23472017-04-05 19:32:27 -040089 - TEST_NAME="C++ Plugin (Std Thread)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090090 BUILD_LIBS="CPP TESTING TUTORIALS"
James E. King, III4eb23472017-04-05 19:32:27 -040091 BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090092
93 - TEST_NAME="Compiler (mingw)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090094 BUILD_LIBS=""
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090095 BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
96 BUILD_ENV=""
97
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +090098 - TEST_NAME="All - GCC (CentOS)"
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +090099 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900100 DISTRO=centos
101
Nobuaki Sukegawaed23b2b2016-02-28 13:47:44 +0900102 - TEST_NAME="C C++ - Clang (CentOS)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900103 BUILD_LIBS="CPP C_GLIB TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900104 BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900105 DISTRO=centos
106
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900107 - TEST_NAME="Python 2.6 (CentOS 6)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +0900108 BUILD_LIBS="PYTHON TESTING TUTORIALS"
Nobuaki Sukegawa33744b02016-01-03 14:24:39 +0900109 BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
110 BUILD_ENV="-e CC=gcc -e CXX=g++"
111 DISTRO=centos6
112
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900113 # Distribution
114 - TEST_NAME="make dist"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900115 SCRIPT="make-dist.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900116 BUILD_ENV="-e CC=gcc -e CXX=g++"
117
118 - TEST_NAME="Debian Packages"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900119 SCRIPT="dpkg.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900120 BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900121
Roger Meier447294f2015-12-11 00:04:41 +0100122 - TEST_NAME="make dist (Debian)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900123 SCRIPT="make-dist.sh"
Roger Meier447294f2015-12-11 00:04:41 +0100124 BUILD_ENV="-e CC=gcc -e CXX=g++"
125 DISTRO=debian
126
127 - TEST_NAME="Debian Packages (Debian)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +0900128 SCRIPT="dpkg.sh"
Roger Meier447294f2015-12-11 00:04:41 +0100129 BUILD_ENV="-e CC=gcc -e CXX=g++"
130 DISTRO=debian
131
Jim Apple147c2842017-03-18 12:56:50 -0700132 # C and C++ undefined behavior. This wraps autotools.sh, but each binary crashes if
133 # undefined behavior occurs. Skips the known flaky tests.
134 - TEST_NAME="UBSan"
135 SCRIPT="ubsan.sh"
136 BUILD_ARG="--without-haskell --without-nodejs --without-perl --without-python"
137
henriqueac8d8e22014-07-23 23:31:04 +0200138matrix:
139 include:
Roger Meier5effab62014-11-16 22:31:33 +0100140 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900141 #
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900142 # C/C++ static code analysis with cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900143 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900144 #
145 # Python code style check with flake8
146 #
147 # search for TODO etc within source tree
148 # some statistics about the code base
149 # some info about the build machine
150 - env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900151 install:
Nobuaki Sukegawa3dd4d8e2016-03-01 01:26:56 +0900152 - travis_retry sudo apt-get update
153 - travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900154 script:
155 # Compiler cppcheck (All)
156 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
157 # C++ cppcheck (All)
158 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
159 # C Glib cppcheck (All)
160 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
161 # Silent error checks
162 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
163 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
164 - 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 +0900165 # Python code style
166 - flake8 --ignore=E501 lib/py
167 - flake8 tutorial/py
168 - flake8 --ignore=E501 test/py
169 - flake8 test/py.twisted
170 - flake8 test/py.tornado
171 - flake8 --ignore=E501 test/test.py
172 - flake8 --ignore=E501 test/crossrunner
173 - flake8 test/features
174 # TODO etc
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900175 - grep -r TODO *
176 - grep -r FIXME *
177 - grep -r HACK *
178 # LoC
179 - sloccount .
180 # System Info
181 - dpkg -l
182 - uname -a