blob: 4f5cc6baa827470d77c068ac2293dd3a598c6445 [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
henriqueac8d8e22014-07-23 23:31:04 +020029env:
Roger Meier5effab62014-11-16 22:31:33 +010030 global:
31 - TEST_NAME=""
32 - CONFIG=""
33 - GHCVER=7.8.3
henriquec0a7d722014-07-26 13:11:12 +020034
henriqueac8d8e22014-07-23 23:31:04 +020035matrix:
36 include:
Roger Meier5effab62014-11-16 22:31:33 +010037 - env:
38 - TEST_NAME="compiler (gcc, automake)"
39 CONFIG="--disable-libs"
40 compiler: gcc
henriqueac8d8e22014-07-23 23:31:04 +020041 before_install:
42 - sh contrib/installCXXDependencies.sh;
43 script:
Roger Meier5effab62014-11-16 22:31:33 +010044 - sh bootstrap.sh;
45 - sh configure $CONFIG;
Roger Meier71bd3602014-11-08 23:13:13 +010046 - make check -j2;
henriqueac8d8e22014-07-23 23:31:04 +020047
Roger Meier5effab62014-11-16 22:31:33 +010048 - env:
49 - TEST_NAME="compiler (gcc, CMake + CPack)"
Pascal Bach54d39692014-12-12 14:10:24 +010050 CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
Roger Meier5effab62014-11-16 22:31:33 +010051 compiler: gcc
henriqueac8d8e22014-07-23 23:31:04 +020052 before_install:
53 - sh contrib/installCXXDependencies.sh;
54 script:
Pascal Bach54d39692014-12-12 14:10:24 +010055 - mkdir build_native && cd build_native && cmake $CONFIG .. && make -j4 && cpack && cd ..;
Roger Meier5effab62014-11-16 22:31:33 +010056
57 - env:
58 - TEST_NAME="compiler (clang, automake)"
59 CONFIG="--disable-libs"
60 compiler: clang
61 before_install:
62 - sh contrib/installCXXDependencies.sh;
63 script:
64 - sh bootstrap.sh;
65 - sh configure $CONFIG;
66 - make check -j2;
67
68 - env:
69 - TEST_NAME="compiler (clang, CMake + CPack)"
Pascal Bach54d39692014-12-12 14:10:24 +010070 CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
Roger Meier5effab62014-11-16 22:31:33 +010071 compiler: clang
72 before_install:
73 - sh contrib/installCXXDependencies.sh;
74 script:
Pascal Bach54d39692014-12-12 14:10:24 +010075 - mkdir build_native && cd build_native && cmake $CONFIG .. && make -j4 && cpack && cd ..;
Roger Meier5effab62014-11-16 22:31:33 +010076
77 - env:
78 - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)"
Pascal Bach54d39692014-12-12 14:10:24 +010079 CONFIG="-DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
Roger Meier5effab62014-11-16 22:31:33 +010080 before_install:
81 - sh contrib/installCXXDependencies.sh;
82 - sudo apt-get install nsis
83 script:
Pascal Bach54d39692014-12-12 14:10:24 +010084 - mkdir build_mingw32 && cd build_mingw32 && cmake $CONFIG .. && make -j4 && cpack && cd ..;
Roger Meier5effab62014-11-16 22:31:33 +010085
86 - env:
87 - TEST_NAME="all (gcc, automake)"
88 CONFIG="--without-erlang --without-python --without-go --without-lua"
89 compiler: gcc
90 before_install:
91 - sh contrib/installCXXDependencies.sh;
92 - sh contrib/installDependencies.sh 1> /dev/null;
93 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH
94 - cabal update
95 script:
96 - sh bootstrap.sh;
97 - sh configure $CONFIG;
Roger Meier71bd3602014-11-08 23:13:13 +010098 - make check -j2;
henriqueac8d8e22014-07-23 23:31:04 +020099
100
Roger Meier5effab62014-11-16 22:31:33 +0100101 - env:
102 - TEST_NAME="C & C++ & Haskell (gcc, automake)"
103 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"
104 compiler: gcc
105 before_install:
106 - sh contrib/installCXXDependencies.sh;
107 - sh contrib/installDependencies.sh 1> /dev/null;
108 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH
109 - cabal update
110 script:
111 - sh bootstrap.sh;
112 - sh configure $CONFIG;
113 - make check -j2;
henriqueac8d8e22014-07-23 23:31:04 +0200114
Pascal Bach54d39692014-12-12 14:10:24 +0100115 - env:
116 - TEST_NAME="all (gcc, CMake + CPack)"
117 CONFIG=""
118 compiler: gcc
119 before_install:
120 - sh contrib/installCXXDependencies.sh;
121 - sh contrib/installDependencies.sh 1> /dev/null;
122 script:
123 - mkdir build_cmake && cd build_cmake && cmake $CONFIG .. && make -j4 && cpack && cd ..;
Roger Meiera0836f62013-05-05 00:19:38 +0200124
Roger Meier5effab62014-11-16 22:31:33 +0100125 - env:
126 - TEST_NAME="Small Set (gcc, automake)"
127 CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java"
128 compiler: gcc
129 before_install:
130 - sh contrib/installCXXDependencies.sh;
131 - sh contrib/installDependencies.sh 1> /dev/null;
132 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH
133 - cabal update
134 script:
135 - sh bootstrap.sh;
136 - sh configure $CONFIG;
137 - make check -j2;
Roger Meiera0836f62013-05-05 00:19:38 +0200138
Roger Meier5effab62014-11-16 22:31:33 +0100139 - env:
140 - TEST_NAME="dist (gcc, automake)"
141 CONFIG=""
142 compiler: gcc
143 before_install:
144 - sh contrib/installCXXDependencies.sh;
145 - sh contrib/installDependencies.sh 1> /dev/null;
146 script:
147 - sh bootstrap.sh;
148 - sh configure $CONFIG;
149 - make dist -j2;
150
151 - env:
152 - TEST_NAME="make cross (gcc, automake)"
153 CONFIG="--without-python"
154 compiler: gcc
155 before_install:
156 - sh contrib/installCXXDependencies.sh;
157 - sh contrib/installDependencies.sh 1> /dev/null;
158 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH
159 - cabal update
160 script:
161 - sh bootstrap.sh;
162 - sh configure $CONFIG;
163 - make cross -j2;
164
165 - env:
166 - TEST_NAME="Debian Packages"
167 compiler: gcc
168 before_install:
169 - sh contrib/installCXXDependencies.sh;
170 - sh contrib/installDependencies.sh 1> /dev/null;
171 - 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
172 script:
173 - dpkg-buildpackage -tc -us -uc
174 - ls -al ..
175
176
177
178 # QA jobs for code analytics and metrics
179
180 # static code analysis with cppcheck (we can add --enable=all later)
181 - env: TEST_NAME="cppcheck (compiler) error"
182 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
183 before_install: sudo apt-get install cppcheck
184 - env: TEST_NAME="cppcheck (cpp) error"
185 script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
186 before_install: sudo apt-get install cppcheck
187 - env: TEST_NAME="cppcheck (c_glib) error"
188 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
189 before_install: sudo apt-get install cppcheck
190 # add --error-exitcode=1 as soon as everything is fixed
191 - env: TEST_NAME="cppcheck (compiler) all"
192 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
193 before_install: sudo apt-get install cppcheck
194 - env: TEST_NAME="cppcheck (cpp) all"
195 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
196 before_install: sudo apt-get install cppcheck
197 - env: TEST_NAME="cppcheck (c_glib) all"
198 script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
199 before_install: sudo apt-get install cppcheck
200
201 # TODO use findbugs for Java
202 # TODO use fxcop for C#
203
204 # TODO do style checks
205
206 # search for TODO within source tree
207 - env: TEST_NAME="TODO"
208 script: grep -r TODO *
209 # search for FIXME within source tree
210 - env: TEST_NAME="FIXME"
211 script: grep -r FIXME *
212 # search for HACK within source tree
213 - env: TEST_NAME="HACK"
214 script: grep -r HACK *
215 # some statistics about the code base
216 - env: TEST_NAME="sloccount"
217 script: sloccount .
218 before_install: sudo apt-get install sloccount
219 # some info about the build machine
220 - env: TEST_NAME="info"
221 script:
222 - dpkg -l
223 - uname -a
224
225# TODO make it perfect ;-r