blob: 5be7c340fad35303465b327e2bd07240cb8db31e [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
henriqued17f1c92014-04-30 16:21:25 +020022language: cpp
henriquea139c912014-04-02 14:45:39 +020023
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100024sudo: required
25
henriquea139c912014-04-02 14:45:39 +020026cache:
27 - apt
28 - npm
henriqued17f1c92014-04-30 16:21:25 +020029 - maven
Roger Meiera0836f62013-05-05 00:19:38 +020030
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090031compiler:
32 - clang
33 - gcc
34
35before_install:
jfarrelle03f7e82015-02-18 23:25:54 -050036 - sh build/travis/installCXXDependencies.sh
37 - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090038 - if [ "$ALL_DEPS" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi
39 - if [ "$ALL_DEPS" != "no" ] ; then cabal update ; fi
Nobuaki Sukegawa2a640c42015-08-23 18:35:15 +090040 # Disabling any cabal concurrent jobs to workaround GHC crashes due to out of memory.
41 # We can safely remove this to speed up cabal install, once Travis infrastructure is upgraded.
42 - if [ "$ALL_DEPS" != "no" ] ; then sed -i 's/^\s*jobs\s*:\s*\$ncpus\s*$/jobs:1/g' $HOME/.cabal/config && cat $HOME/.cabal/config | grep jobs ; fi
43
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090044
45script:
henrique7f9fa882015-02-23 10:27:34 +080046 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then mkdir cmake_build && cd cmake_build && cmake -GNinja -DQT_MOC_EXECUTABLE="moq-qt5" $CMAKE_CONFIG $TRAVIS_BUILD_DIR ; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090047 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ninja ; fi
48 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then cpack ; cd $TRAVIS_BUILD_DIR ; fi
49 - if [ "x$CONFIG" != "xnone" ] ; then sh bootstrap.sh ; fi
50 - if [ "x$CONFIG" != "xnone" ] ; then sh configure $CONFIG ; fi
51 - if [ "x$CONFIG" != "xnone" ] ; then make $MAKE_TARGET -j2 ; fi
52
Roger Meier7ed94ef2015-04-26 16:55:35 +020053after_failure:
54 - if [ "x$ERROR_LOG" != "xnone" ] ; then cat $ERROR_LOG ; fi
55
henriqueac8d8e22014-07-23 23:31:04 +020056env:
Roger Meier5effab62014-11-16 22:31:33 +010057 global:
58 - TEST_NAME=""
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090059 - CMAKE_CONFIG="none"
60 - CONFIG="none"
61 - MAKE_TARGET="check"
62 - ALL_DEPS="no"
Roger Meier5effab62014-11-16 22:31:33 +010063 - GHCVER=7.8.3
Nobuaki Sukegawafd5a4d22015-05-10 16:14:03 +090064 - ERROR_LOG="none"
henriquec0a7d722014-07-26 13:11:12 +020065
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090066 matrix:
67 # Put it here because it's most time consuming
Roger Meier41ad4342015-03-24 22:30:40 +010068 - TEST_NAME="make cross (automake)"
Roger Meier41ad4342015-03-24 22:30:40 +010069 THRIFT_CROSSTEST_CONCURRENCY=6
70 CONFIG="--enable-tutorial=no --without-erlang --without-lua --without-haxe --without-d"
71 ALL_DEPS="yes"
Nobuaki Sukegawaf5b795d2015-03-29 14:48:48 +090072 MAKE_TARGET="cross"
Roger Meier7ed94ef2015-04-26 16:55:35 +020073 ERROR_LOG="test/log/unexpected_failures.log"
Roger Meier41ad4342015-03-24 22:30:40 +010074
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090075 # CMake builds
76 - TEST_NAME="compiler (CMake + CPack)"
77 CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
78 - TEST_NAME="all (CMake + CPack)"
79 CMAKE_CONFIG=""
80 ALL_DEPS="yes"
81 - TEST_NAME="C++/boost-threads (CMake + CPack)"
Nobuaki Sukegawa27378fa2015-10-29 00:41:39 +090082 CMAKE_CONFIG="-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_BOOSTTHREADS=ON"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090083 - TEST_NAME="C++/std-threads (CMake + CPack)"
Nobuaki Sukegawa27378fa2015-10-29 00:41:39 +090084 CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_STDTHREADS=ON"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090085 - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)"
Roger Meier4ead5202015-05-15 16:21:41 +020086 CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090087
88 # Autotool builds
89 # TODO: Remove them as migration is made
90 - TEST_NAME="compiler (automake)"
91 CONFIG="--disable-libs"
92 - TEST_NAME="all (automake)"
93 CONFIG="--without-erlang --without-python --without-go --without-lua"
94 ALL_DEPS="yes"
95 - TEST_NAME="C & C++ & Haskell (automake)"
96 CONFIG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php-extension --without-ruby --without-go --without-d"
97 ALL_DEPS="yes"
98 - TEST_NAME="Small Set (automake)"
99 CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java"
100 ALL_DEPS="yes"
Roger Meier41ad4342015-03-24 22:30:40 +0100101 - TEST_NAME="dist (automake)"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900102 CONFIG=""
103 ALL_DEPS="yes"
104 MAKE_TARGET="dist"
105
henriqueac8d8e22014-07-23 23:31:04 +0200106matrix:
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900107 allow_failures:
108 # gcc fails on travis seemingly due to out of memory
109 - compiler: gcc
110
111 exclude:
112 # This one takes very long
113 - compiler: gcc
Roger Meier41ad4342015-03-24 22:30:40 +0100114 env: TEST_NAME="make cross (automake)" CONFIG="--without-python" ALL_DEPS="yes" MAKE_TARGET="cross"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900115
116 # Does not use native compiler, no need to do it twice
117 - compiler: gcc
Roger Meier4ead5202015-05-15 16:21:41 +0200118 env: TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900119 - compiler: gcc
Roger Meier41ad4342015-03-24 22:30:40 +0100120 env: TEST_NAME="dist (automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900121
henriqueac8d8e22014-07-23 23:31:04 +0200122 include:
Roger Meier5effab62014-11-16 22:31:33 +0100123 - env:
Roger Meier5effab62014-11-16 22:31:33 +0100124 - TEST_NAME="Debian Packages"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900125 compiler: clang
Roger Meier5effab62014-11-16 22:31:33 +0100126 before_install:
jfarrelle03f7e82015-02-18 23:25:54 -0500127 - sh build/travis/installCXXDependencies.sh;
128 - sh build/travis/installDependencies.sh 1> /dev/null;
Roger Meier5effab62014-11-16 22:31:33 +0100129 - sudo apt-get install build-essential mono-gmcs mono-devel libmono-system-web2.0-cil erlang-base ruby1.8-dev python-all python-all-dev python-all-dbg php5 php5-dev
130 script:
131 - dpkg-buildpackage -tc -us -uc
132 - ls -al ..
133
134
Roger Meier5effab62014-11-16 22:31:33 +0100135 # QA jobs for code analytics and metrics
136
137 # static code analysis with cppcheck (we can add --enable=all later)
138 - env: TEST_NAME="cppcheck (compiler) error"
139 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
140 before_install: sudo apt-get install cppcheck
141 - env: TEST_NAME="cppcheck (cpp) error"
142 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
143 before_install: sudo apt-get install cppcheck
144 - env: TEST_NAME="cppcheck (c_glib) error"
145 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
146 before_install: sudo apt-get install cppcheck
147 # add --error-exitcode=1 as soon as everything is fixed
148 - env: TEST_NAME="cppcheck (compiler) all"
149 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
150 before_install: sudo apt-get install cppcheck
151 - env: TEST_NAME="cppcheck (cpp) all"
152 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
153 before_install: sudo apt-get install cppcheck
154 - env: TEST_NAME="cppcheck (c_glib) all"
155 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
156 before_install: sudo apt-get install cppcheck
157
158 # TODO use findbugs for Java
159 # TODO use fxcop for C#
160
161 # TODO do style checks
162
163 # search for TODO within source tree
164 - env: TEST_NAME="TODO"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900165 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100166 script: grep -r TODO *
167 # search for FIXME within source tree
168 - env: TEST_NAME="FIXME"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900169 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100170 script: grep -r FIXME *
171 # search for HACK within source tree
172 - env: TEST_NAME="HACK"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900173 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100174 script: grep -r HACK *
175 # some statistics about the code base
176 - env: TEST_NAME="sloccount"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900177 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100178 script: sloccount .
179 before_install: sudo apt-get install sloccount
180 # some info about the build machine
181 - env: TEST_NAME="info"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900182 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100183 script:
184 - dpkg -l
185 - uname -a
186
187# TODO make it perfect ;-r
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900188#