blob: cfa3c85ac31aec9a19e9c3b633cc202cb307c153 [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
24cache:
25 - apt
26 - npm
henriqued17f1c92014-04-30 16:21:25 +020027 - maven
Roger Meiera0836f62013-05-05 00:19:38 +020028
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090029compiler:
30 - clang
31 - gcc
32
33before_install:
jfarrelle03f7e82015-02-18 23:25:54 -050034 - sh build/travis/installCXXDependencies.sh
35 - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090036 - if [ "$ALL_DEPS" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi
37 - if [ "$ALL_DEPS" != "no" ] ; then cabal update ; fi
38
39script:
40 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then mkdir build && cd build && cmake -GNinja -DQT_MOC_EXECUTABLE="moq-qt5" $CMAKE_CONFIG $TRAVIS_BUILD_DIR ; fi
41 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ninja ; fi
42 - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then cpack ; cd $TRAVIS_BUILD_DIR ; fi
43 - if [ "x$CONFIG" != "xnone" ] ; then sh bootstrap.sh ; fi
44 - if [ "x$CONFIG" != "xnone" ] ; then sh configure $CONFIG ; fi
45 - if [ "x$CONFIG" != "xnone" ] ; then make $MAKE_TARGET -j2 ; fi
46
henriqueac8d8e22014-07-23 23:31:04 +020047env:
Roger Meier5effab62014-11-16 22:31:33 +010048 global:
49 - TEST_NAME=""
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090050 - CMAKE_CONFIG="none"
51 - CONFIG="none"
52 - MAKE_TARGET="check"
53 - ALL_DEPS="no"
Roger Meier5effab62014-11-16 22:31:33 +010054 - GHCVER=7.8.3
henriquec0a7d722014-07-26 13:11:12 +020055
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090056 matrix:
57 # Put it here because it's most time consuming
58 - TEST_NAME="make cross (gcc, automake)"
59 CONFIG="--without-python"
60 ALL_DEPS="yes"
61 MAKE_TARGET="cross"
62
63 # CMake builds
64 - TEST_NAME="compiler (CMake + CPack)"
65 CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
66 - TEST_NAME="all (CMake + CPack)"
67 CMAKE_CONFIG=""
68 ALL_DEPS="yes"
69 - TEST_NAME="C++/boost-threads (CMake + CPack)"
70 CMAKE_CONFIG="-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_BOOSTTHREADS=ON"
71 - TEST_NAME="C++/std-threads (CMake + CPack)"
72 CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_STDTHREADS=ON"
73 - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)"
74 CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
75
76 # Autotool builds
77 # TODO: Remove them as migration is made
78 - TEST_NAME="compiler (automake)"
79 CONFIG="--disable-libs"
80 - TEST_NAME="all (automake)"
81 CONFIG="--without-erlang --without-python --without-go --without-lua"
82 ALL_DEPS="yes"
83 - TEST_NAME="C & C++ & Haskell (automake)"
84 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"
85 ALL_DEPS="yes"
86 - TEST_NAME="Small Set (automake)"
87 CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java"
88 ALL_DEPS="yes"
89 - TEST_NAME="dist (gcc, automake)"
90 CONFIG=""
91 ALL_DEPS="yes"
92 MAKE_TARGET="dist"
93
henriqueac8d8e22014-07-23 23:31:04 +020094matrix:
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090095 allow_failures:
96 # gcc fails on travis seemingly due to out of memory
97 - compiler: gcc
98
99 exclude:
100 # This one takes very long
101 - compiler: gcc
102 env: TEST_NAME="make cross (gcc, automake)" CONFIG="--without-python" ALL_DEPS="yes" MAKE_TARGET="cross"
103
104 # Does not use native compiler, no need to do it twice
105 - compiler: gcc
106 env: TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
107 - compiler: gcc
108 env: TEST_NAME="dist (gcc, automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist"
109
henriqueac8d8e22014-07-23 23:31:04 +0200110 include:
Roger Meier5effab62014-11-16 22:31:33 +0100111 - env:
Roger Meier5effab62014-11-16 22:31:33 +0100112 - TEST_NAME="Debian Packages"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900113 compiler: clang
Roger Meier5effab62014-11-16 22:31:33 +0100114 before_install:
jfarrelle03f7e82015-02-18 23:25:54 -0500115 - sh build/travis/installCXXDependencies.sh;
116 - sh build/travis/installDependencies.sh 1> /dev/null;
Roger Meier5effab62014-11-16 22:31:33 +0100117 - 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
118 script:
119 - dpkg-buildpackage -tc -us -uc
120 - ls -al ..
121
122
Roger Meier5effab62014-11-16 22:31:33 +0100123 # QA jobs for code analytics and metrics
124
125 # static code analysis with cppcheck (we can add --enable=all later)
126 - env: TEST_NAME="cppcheck (compiler) error"
127 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
128 before_install: sudo apt-get install cppcheck
129 - env: TEST_NAME="cppcheck (cpp) error"
130 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
131 before_install: sudo apt-get install cppcheck
132 - env: TEST_NAME="cppcheck (c_glib) error"
133 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
134 before_install: sudo apt-get install cppcheck
135 # add --error-exitcode=1 as soon as everything is fixed
136 - env: TEST_NAME="cppcheck (compiler) all"
137 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
138 before_install: sudo apt-get install cppcheck
139 - env: TEST_NAME="cppcheck (cpp) all"
140 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
141 before_install: sudo apt-get install cppcheck
142 - env: TEST_NAME="cppcheck (c_glib) all"
143 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
144 before_install: sudo apt-get install cppcheck
145
146 # TODO use findbugs for Java
147 # TODO use fxcop for C#
148
149 # TODO do style checks
150
151 # search for TODO within source tree
152 - env: TEST_NAME="TODO"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900153 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100154 script: grep -r TODO *
155 # search for FIXME within source tree
156 - env: TEST_NAME="FIXME"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900157 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100158 script: grep -r FIXME *
159 # search for HACK within source tree
160 - env: TEST_NAME="HACK"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900161 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100162 script: grep -r HACK *
163 # some statistics about the code base
164 - env: TEST_NAME="sloccount"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900165 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100166 script: sloccount .
167 before_install: sudo apt-get install sloccount
168 # some info about the build machine
169 - env: TEST_NAME="info"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900170 before_install:
Roger Meier5effab62014-11-16 22:31:33 +0100171 script:
172 - dpkg -l
173 - uname -a
174
175# TODO make it perfect ;-r
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900176#