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 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 29 | compiler: |
| 30 | - clang |
| 31 | - gcc |
| 32 | |
| 33 | before_install: |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 34 | - sh build/travis/installCXXDependencies.sh |
| 35 | - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 36 | - 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 | |
| 39 | script: |
henrique | 7f9fa88 | 2015-02-23 10:27:34 +0800 | [diff] [blame] | 40 | - 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 | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 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 | |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 47 | after_failure: |
| 48 | - if [ "x$ERROR_LOG" != "xnone" ] ; then cat $ERROR_LOG ; fi |
| 49 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 50 | env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 51 | global: |
| 52 | - TEST_NAME="" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 53 | - CMAKE_CONFIG="none" |
| 54 | - CONFIG="none" |
| 55 | - MAKE_TARGET="check" |
| 56 | - ALL_DEPS="no" |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 57 | - GHCVER=7.8.3 |
henrique | c0a7d72 | 2014-07-26 13:11:12 +0200 | [diff] [blame] | 58 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 59 | matrix: |
| 60 | # Put it here because it's most time consuming |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 61 | - TEST_NAME="make cross (automake)" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 62 | THRIFT_CROSSTEST_CONCURRENCY=6 |
| 63 | CONFIG="--enable-tutorial=no --without-erlang --without-lua --without-haxe --without-d" |
| 64 | ALL_DEPS="yes" |
Nobuaki Sukegawa | f5b795d | 2015-03-29 14:48:48 +0900 | [diff] [blame] | 65 | MAKE_TARGET="cross" |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 66 | ERROR_LOG="test/log/unexpected_failures.log" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 67 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 68 | # CMake builds |
| 69 | - TEST_NAME="compiler (CMake + CPack)" |
| 70 | CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
| 71 | - TEST_NAME="all (CMake + CPack)" |
| 72 | CMAKE_CONFIG="" |
| 73 | ALL_DEPS="yes" |
| 74 | - TEST_NAME="C++/boost-threads (CMake + CPack)" |
| 75 | CMAKE_CONFIG="-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_BOOSTTHREADS=ON" |
| 76 | - TEST_NAME="C++/std-threads (CMake + CPack)" |
| 77 | CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_STDTHREADS=ON" |
| 78 | - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" |
| 79 | CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
| 80 | |
| 81 | # Autotool builds |
| 82 | # TODO: Remove them as migration is made |
| 83 | - TEST_NAME="compiler (automake)" |
| 84 | CONFIG="--disable-libs" |
| 85 | - TEST_NAME="all (automake)" |
| 86 | CONFIG="--without-erlang --without-python --without-go --without-lua" |
| 87 | ALL_DEPS="yes" |
| 88 | - TEST_NAME="C & C++ & Haskell (automake)" |
| 89 | 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" |
| 90 | ALL_DEPS="yes" |
| 91 | - TEST_NAME="Small Set (automake)" |
| 92 | CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java" |
| 93 | ALL_DEPS="yes" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 94 | - TEST_NAME="dist (automake)" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 95 | CONFIG="" |
| 96 | ALL_DEPS="yes" |
| 97 | MAKE_TARGET="dist" |
| 98 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 99 | matrix: |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 100 | allow_failures: |
| 101 | # gcc fails on travis seemingly due to out of memory |
| 102 | - compiler: gcc |
| 103 | |
| 104 | exclude: |
| 105 | # This one takes very long |
| 106 | - compiler: gcc |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 107 | 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] | 108 | |
| 109 | # Does not use native compiler, no need to do it twice |
| 110 | - compiler: gcc |
| 111 | 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" |
| 112 | - compiler: gcc |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 113 | env: TEST_NAME="dist (automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 114 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 115 | include: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 116 | - env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 117 | - TEST_NAME="Debian Packages" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 118 | compiler: clang |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 119 | before_install: |
jfarrell | e03f7e8 | 2015-02-18 23:25:54 -0500 | [diff] [blame] | 120 | - sh build/travis/installCXXDependencies.sh; |
| 121 | - sh build/travis/installDependencies.sh 1> /dev/null; |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 122 | - 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 |
| 123 | script: |
| 124 | - dpkg-buildpackage -tc -us -uc |
| 125 | - ls -al .. |
| 126 | |
| 127 | |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 128 | # QA jobs for code analytics and metrics |
| 129 | |
| 130 | # static code analysis with cppcheck (we can add --enable=all later) |
| 131 | - env: TEST_NAME="cppcheck (compiler) error" |
| 132 | script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src |
| 133 | before_install: sudo apt-get install cppcheck |
| 134 | - env: TEST_NAME="cppcheck (cpp) error" |
| 135 | script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 136 | before_install: sudo apt-get install cppcheck |
| 137 | - env: TEST_NAME="cppcheck (c_glib) error" |
| 138 | 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 |
| 139 | before_install: sudo apt-get install cppcheck |
| 140 | # add --error-exitcode=1 as soon as everything is fixed |
| 141 | - env: TEST_NAME="cppcheck (compiler) all" |
| 142 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src |
| 143 | before_install: sudo apt-get install cppcheck |
| 144 | - env: TEST_NAME="cppcheck (cpp) all" |
| 145 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 146 | before_install: sudo apt-get install cppcheck |
| 147 | - env: TEST_NAME="cppcheck (c_glib) all" |
| 148 | script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
| 149 | before_install: sudo apt-get install cppcheck |
| 150 | |
| 151 | # TODO use findbugs for Java |
| 152 | # TODO use fxcop for C# |
| 153 | |
| 154 | # TODO do style checks |
| 155 | |
| 156 | # search for TODO within source tree |
| 157 | - env: TEST_NAME="TODO" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 158 | before_install: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 159 | script: grep -r TODO * |
| 160 | # search for FIXME within source tree |
| 161 | - env: TEST_NAME="FIXME" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 162 | before_install: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 163 | script: grep -r FIXME * |
| 164 | # search for HACK within source tree |
| 165 | - env: TEST_NAME="HACK" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 166 | before_install: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 167 | script: grep -r HACK * |
| 168 | # some statistics about the code base |
| 169 | - env: TEST_NAME="sloccount" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 170 | before_install: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 171 | script: sloccount . |
| 172 | before_install: sudo apt-get install sloccount |
| 173 | # some info about the build machine |
| 174 | - env: TEST_NAME="info" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 175 | before_install: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 176 | script: |
| 177 | - dpkg -l |
| 178 | - uname -a |
| 179 | |
| 180 | # TODO make it perfect ;-r |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 181 | # |