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 | |
Henrique Mendonça | aba4b1f | 2015-06-26 20:56:18 +1000 | [diff] [blame] | 24 | sudo: required |
| 25 | |
henrique | a139c91 | 2014-04-02 14:45:39 +0200 | [diff] [blame] | 26 | cache: |
| 27 | - apt |
| 28 | - npm |
henrique | d17f1c9 | 2014-04-30 16:21:25 +0200 | [diff] [blame] | 29 | - maven |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 30 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 31 | compiler: |
| 32 | - clang |
| 33 | - gcc |
| 34 | |
| 35 | before_install: |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 36 | - sh build/travis/installCXXDependencies.sh |
| 37 | - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 38 | - if [ "$BUILD_HASKELL" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi |
| 39 | - if [ "$BUILD_HASKELL" != "no" ] ; then cabal update ; fi |
Nobuaki Sukegawa | 2a640c4 | 2015-08-23 18:35:15 +0900 | [diff] [blame] | 40 | # 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. |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 42 | - if [ "$BUILD_HASKELL" != "no" ] ; then sed -i 's/^\s*jobs\s*:\s*\$ncpus\s*$/jobs:1/g' $HOME/.cabal/config && cat $HOME/.cabal/config | grep jobs ; fi |
Nobuaki Sukegawa | 2a640c4 | 2015-08-23 18:35:15 +0900 | [diff] [blame] | 43 | |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 44 | before_script: |
| 45 | - sudo /etc/init.d/mysql stop |
| 46 | - sudo /etc/init.d/postgresql stop |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 47 | |
| 48 | script: |
henrique | 7f9fa88 | 2015-02-23 10:27:34 +0800 | [diff] [blame] | 49 | - 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 Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 50 | - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ninja -j $CONCURRENT_JOBS ; fi |
| 51 | - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then cpack ; fi |
| 52 | - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ctest -VV -E "(concurrency_test|processor_test|Haskell)" ; fi |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 53 | - if [ "x$CONFIG" != "xnone" ] ; then sh bootstrap.sh ; fi |
| 54 | - if [ "x$CONFIG" != "xnone" ] ; then sh configure $CONFIG ; fi |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 55 | - if [ "x$CONFIG" != "xnone" ] ; then make $MAKE_TARGET -j $CONCURRENT_JOBS ; fi |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 56 | |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 57 | after_failure: |
| 58 | - if [ "x$ERROR_LOG" != "xnone" ] ; then cat $ERROR_LOG ; fi |
| 59 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 60 | env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 61 | global: |
| 62 | - TEST_NAME="" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 63 | - CMAKE_CONFIG="none" |
| 64 | - CONFIG="none" |
| 65 | - MAKE_TARGET="check" |
| 66 | - ALL_DEPS="no" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 67 | # Invoke cabal only when necessary because it is flaky due to network and package updates. |
| 68 | - BUILD_HASKELL="no" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 69 | - GHCVER=7.8.3 |
Nobuaki Sukegawa | fd5a4d2 | 2015-05-10 16:14:03 +0900 | [diff] [blame] | 70 | - ERROR_LOG="none" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 71 | - CONCURRENT_JOBS=2 |
henrique | c0a7d72 | 2014-07-26 13:11:12 +0200 | [diff] [blame] | 72 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 73 | matrix: |
| 74 | # Put it here because it's most time consuming |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 75 | - TEST_NAME="make cross (automake)" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 76 | THRIFT_CROSSTEST_CONCURRENCY=6 |
Nobuaki Sukegawa | 826ea99 | 2015-10-28 22:19:45 +0900 | [diff] [blame] | 77 | CONFIG="--enable-tutorial=no --without-lua --without-haxe --without-d" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 78 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 79 | BUILD_HASKELL="yes" |
Nobuaki Sukegawa | f5b795d | 2015-03-29 14:48:48 +0900 | [diff] [blame] | 80 | MAKE_TARGET="cross" |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 81 | ERROR_LOG="test/log/unexpected_failures.log" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 82 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 83 | # CMake builds |
| 84 | - TEST_NAME="compiler (CMake + CPack)" |
| 85 | CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
| 86 | - TEST_NAME="all (CMake + CPack)" |
| 87 | CMAKE_CONFIG="" |
| 88 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 89 | BUILD_HASKELL="yes" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 90 | - TEST_NAME="C++/boost-threads (CMake + CPack)" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 91 | CMAKE_CONFIG="-DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_BOOSTTHREADS=ON" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 92 | - TEST_NAME="C++/std-threads (CMake + CPack)" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 93 | CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_STDTHREADS=ON" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 94 | - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" |
Roger Meier | 4ead520 | 2015-05-15 16:21:41 +0200 | [diff] [blame] | 95 | CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 96 | |
| 97 | # Autotool builds |
| 98 | # TODO: Remove them as migration is made |
| 99 | - TEST_NAME="compiler (automake)" |
| 100 | CONFIG="--disable-libs" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 101 | |
Nobuaki Sukegawa | 73fae0f | 2015-12-01 23:49:53 +0900 | [diff] [blame] | 102 | # TODO: Enable tutorial once "make check -C tutorial/go" is fixed |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 103 | - TEST_NAME="C C# D Dart Erlang Go Haxe (automake)" |
Nobuaki Sukegawa | 73fae0f | 2015-12-01 23:49:53 +0900 | [diff] [blame] | 104 | CONFIG="--without-cpp --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --enable-tutorial=no" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 105 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 106 | |
| 107 | - TEST_NAME="Java Lua Node.js Perl PHP Python Ruby (automake)" |
| 108 | CONFIG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 109 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 110 | |
| 111 | # Isolate unstable builds from others |
| 112 | - TEST_NAME="C++ (automake)" |
| 113 | CONFIG="--without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby" |
| 114 | |
| 115 | - TEST_NAME="Haskell (automake)" |
| 116 | CONFIG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 117 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 118 | BUILD_HASKELL="yes" |
| 119 | |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 120 | - TEST_NAME="dist (automake)" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 121 | CONFIG="" |
| 122 | ALL_DEPS="yes" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 123 | BUILD_HASKELL="yes" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 124 | MAKE_TARGET="dist" |
| 125 | |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 126 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 127 | matrix: |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 128 | allow_failures: |
| 129 | # gcc fails on travis seemingly due to out of memory |
| 130 | - compiler: gcc |
| 131 | |
| 132 | exclude: |
| 133 | # This one takes very long |
| 134 | - compiler: gcc |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 135 | env: TEST_NAME="make cross (automake)" CONFIG="--without-python" ALL_DEPS="yes" MAKE_TARGET="cross" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 136 | |
| 137 | # Does not use native compiler, no need to do it twice |
| 138 | - compiler: gcc |
Roger Meier | 4ead520 | 2015-05-15 16:21:41 +0200 | [diff] [blame] | 139 | 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 Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 140 | - compiler: gcc |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 141 | env: TEST_NAME="dist (automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 142 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 143 | include: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 144 | - env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 145 | - TEST_NAME="Debian Packages" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 146 | compiler: clang |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 147 | before_install: |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 148 | - sh build/travis/installCXXDependencies.sh; |
| 149 | - sh build/travis/installDependencies.sh 1> /dev/null; |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 150 | - 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 |
| 151 | script: |
| 152 | - dpkg-buildpackage -tc -us -uc |
| 153 | - ls -al .. |
| 154 | |
| 155 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 156 | # QA jobs for code analytics and metrics |
| 157 | |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 158 | # static code analysis with cppcheck |
| 159 | # add --error-exitcode=1 to --enable=all as soon as everything is fixed |
| 160 | - env: TEST_NAME="cppcheck" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 161 | before_install: sudo apt-get install cppcheck |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 162 | script: |
| 163 | # Compiler cppcheck (All) |
| 164 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src |
| 165 | # C++ cppcheck (All) |
| 166 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 167 | # C Glib cppcheck (All) |
| 168 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
| 169 | # Silent error checks |
| 170 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src |
| 171 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 172 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 173 | |
| 174 | # TODO use findbugs for Java |
| 175 | # TODO use fxcop for C# |
| 176 | |
| 177 | # TODO do style checks |
| 178 | |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 179 | # search for TODO etc within source tree |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 180 | # some statistics about the code base |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 181 | # some info about the build machine |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 182 | - env: TEST_NAME="TODO FIXME HACK, LoC and system info" |
| 183 | before_install: sudo apt-get install sloccount |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 184 | script: |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 185 | - grep -r TODO * |
| 186 | - grep -r FIXME * |
| 187 | - grep -r HACK * |
| 188 | # LoC |
| 189 | - sloccount . |
| 190 | # System Info |
| 191 | - dpkg -l |
| 192 | - uname -a |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 193 | |
| 194 | # TODO make it perfect ;-r |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 195 | # |