Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 1 | # |
| 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 | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 22 | language: cpp |
henrique | a139c91 | 2014-04-02 14:45:39 +0200 | [diff] [blame] | 23 | |
| 24 | cache: |
| 25 | - apt |
| 26 | - npm |
henrique | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 27 | - maven |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 28 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 29 | env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 30 | global: |
| 31 | - TEST_NAME="" |
| 32 | - CONFIG="" |
| 33 | - GHCVER=7.8.3 |
henrique | c0a7d72 | 2014-07-26 13:11:12 +0200 | [diff] [blame] | 34 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 35 | matrix: |
| 36 | include: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 37 | - env: |
| 38 | - TEST_NAME="compiler (gcc, automake)" |
| 39 | CONFIG="--disable-libs" |
| 40 | compiler: gcc |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 41 | before_install: |
| 42 | - sh contrib/installCXXDependencies.sh; |
| 43 | script: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 44 | - sh bootstrap.sh; |
| 45 | - sh configure $CONFIG; |
Roger Meier | 71bd360 | 2014-11-08 23:13:13 +0100 | [diff] [blame] | 46 | - make check -j2; |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 47 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 48 | - env: |
| 49 | - TEST_NAME="compiler (gcc, CMake + CPack)" |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 50 | CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 51 | compiler: gcc |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 52 | before_install: |
| 53 | - sh contrib/installCXXDependencies.sh; |
| 54 | script: |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 55 | - mkdir build_native && cd build_native && cmake $CONFIG .. && make -j4 && cpack && cd ..; |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 56 | |
| 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 Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 70 | CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 71 | compiler: clang |
| 72 | before_install: |
| 73 | - sh contrib/installCXXDependencies.sh; |
| 74 | script: |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 75 | - mkdir build_native && cd build_native && cmake $CONFIG .. && make -j4 && cpack && cd ..; |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 76 | |
| 77 | - env: |
| 78 | - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 79 | CONFIG="-DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 80 | before_install: |
| 81 | - sh contrib/installCXXDependencies.sh; |
| 82 | - sudo apt-get install nsis |
| 83 | script: |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 84 | - mkdir build_mingw32 && cd build_mingw32 && cmake $CONFIG .. && make -j4 && cpack && cd ..; |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 85 | |
| 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 Meier | 71bd360 | 2014-11-08 23:13:13 +0100 | [diff] [blame] | 98 | - make check -j2; |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 99 | |
| 100 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 101 | - 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; |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 114 | |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 115 | - env: |
Nobuaki Sukegawa | 2825664 | 2014-12-16 03:24:37 +0900 | [diff] [blame] | 116 | - TEST_NAME="C++/boost-threads (gcc, CMake)" |
| 117 | CONFIG="-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_BOOSTTHREADS=ON" |
| 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 && cd ..; |
| 124 | |
| 125 | - env: |
| 126 | - TEST_NAME="C++/std-threads (gcc, CMake)" |
| 127 | CONFIG="-DCMAKE_CXX_FLAGS=-std=c++11 -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_STDTHREADS=ON" |
| 128 | compiler: gcc |
| 129 | before_install: |
| 130 | - sh contrib/installCXXDependencies.sh; |
| 131 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 132 | script: |
| 133 | - mkdir build_cmake && cd build_cmake && cmake $CONFIG .. && make -j4 && cd ..; |
| 134 | |
| 135 | - env: |
Pascal Bach | 54d3969 | 2014-12-12 14:10:24 +0100 | [diff] [blame] | 136 | - TEST_NAME="all (gcc, CMake + CPack)" |
| 137 | CONFIG="" |
| 138 | compiler: gcc |
| 139 | before_install: |
| 140 | - sh contrib/installCXXDependencies.sh; |
| 141 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 142 | script: |
| 143 | - mkdir build_cmake && cd build_cmake && cmake $CONFIG .. && make -j4 && cpack && cd ..; |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 144 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 145 | - env: |
| 146 | - TEST_NAME="Small Set (gcc, automake)" |
| 147 | CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java" |
| 148 | compiler: gcc |
| 149 | before_install: |
| 150 | - sh contrib/installCXXDependencies.sh; |
| 151 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 152 | - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH |
| 153 | - cabal update |
| 154 | script: |
| 155 | - sh bootstrap.sh; |
| 156 | - sh configure $CONFIG; |
| 157 | - make check -j2; |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 158 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 159 | - env: |
| 160 | - TEST_NAME="dist (gcc, automake)" |
| 161 | CONFIG="" |
| 162 | compiler: gcc |
| 163 | before_install: |
| 164 | - sh contrib/installCXXDependencies.sh; |
| 165 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 166 | script: |
| 167 | - sh bootstrap.sh; |
| 168 | - sh configure $CONFIG; |
| 169 | - make dist -j2; |
| 170 | |
| 171 | - env: |
| 172 | - TEST_NAME="make cross (gcc, automake)" |
| 173 | CONFIG="--without-python" |
| 174 | compiler: gcc |
| 175 | before_install: |
| 176 | - sh contrib/installCXXDependencies.sh; |
| 177 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 178 | - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH |
| 179 | - cabal update |
| 180 | script: |
| 181 | - sh bootstrap.sh; |
| 182 | - sh configure $CONFIG; |
| 183 | - make cross -j2; |
| 184 | |
| 185 | - env: |
| 186 | - TEST_NAME="Debian Packages" |
| 187 | compiler: gcc |
| 188 | before_install: |
| 189 | - sh contrib/installCXXDependencies.sh; |
| 190 | - sh contrib/installDependencies.sh 1> /dev/null; |
| 191 | - 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 |
| 192 | script: |
| 193 | - dpkg-buildpackage -tc -us -uc |
| 194 | - ls -al .. |
| 195 | |
| 196 | |
| 197 | |
| 198 | # QA jobs for code analytics and metrics |
| 199 | |
| 200 | # static code analysis with cppcheck (we can add --enable=all later) |
| 201 | - env: TEST_NAME="cppcheck (compiler) error" |
| 202 | script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src |
| 203 | before_install: sudo apt-get install cppcheck |
| 204 | - env: TEST_NAME="cppcheck (cpp) error" |
| 205 | script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 206 | before_install: sudo apt-get install cppcheck |
| 207 | - env: TEST_NAME="cppcheck (c_glib) error" |
| 208 | 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 |
| 209 | before_install: sudo apt-get install cppcheck |
| 210 | # add --error-exitcode=1 as soon as everything is fixed |
| 211 | - env: TEST_NAME="cppcheck (compiler) all" |
| 212 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src |
| 213 | before_install: sudo apt-get install cppcheck |
| 214 | - env: TEST_NAME="cppcheck (cpp) all" |
| 215 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 216 | before_install: sudo apt-get install cppcheck |
| 217 | - env: TEST_NAME="cppcheck (c_glib) all" |
| 218 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
| 219 | before_install: sudo apt-get install cppcheck |
| 220 | |
| 221 | # TODO use findbugs for Java |
| 222 | # TODO use fxcop for C# |
| 223 | |
| 224 | # TODO do style checks |
| 225 | |
| 226 | # search for TODO within source tree |
| 227 | - env: TEST_NAME="TODO" |
| 228 | script: grep -r TODO * |
| 229 | # search for FIXME within source tree |
| 230 | - env: TEST_NAME="FIXME" |
| 231 | script: grep -r FIXME * |
| 232 | # search for HACK within source tree |
| 233 | - env: TEST_NAME="HACK" |
| 234 | script: grep -r HACK * |
| 235 | # some statistics about the code base |
| 236 | - env: TEST_NAME="sloccount" |
| 237 | script: sloccount . |
| 238 | before_install: sudo apt-get install sloccount |
| 239 | # some info about the build machine |
| 240 | - env: TEST_NAME="info" |
| 241 | script: |
| 242 | - dpkg -l |
| 243 | - uname -a |
| 244 | |
| 245 | # TODO make it perfect ;-r |