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 Mendonça | aba4b1f | 2015-06-26 20:56:18 +1000 | [diff] [blame] | 22 | sudo: required |
| 23 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 24 | services: |
| 25 | - docker |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 26 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 27 | install: |
Nobuaki Sukegawa | 0156aae | 2015-12-09 23:21:29 +0900 | [diff] [blame] | 28 | - docker pull thrift/$DISTRO:latest || true |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 29 | - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/ |
| 30 | - docker build -q -t thrift-build build/docker/$DISTRO |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 31 | |
| 32 | script: |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 33 | - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 34 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 35 | env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 36 | global: |
| 37 | - TEST_NAME="" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 38 | - BUILD_CMD="none" |
| 39 | - BUILD_ARG="" |
| 40 | - BUILD_ENV="-e CC=clang -e CXX=clang++" |
| 41 | - DISTRO=ubuntu |
henrique | c0a7d72 | 2014-07-26 13:11:12 +0200 | [diff] [blame] | 42 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 43 | matrix: |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 44 | # TODO: Break up by protocol types to avoid 50min limit |
| 45 | - TEST_NAME="Cross Language Tests" |
| 46 | BUILD_CMD="../cross-test.sh" |
| 47 | BUILD_ARG="--enable-tutorial=no" |
| 48 | BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 49 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 50 | # TODO: Remove them once migrated to CMake |
| 51 | # Autotools builds |
| 52 | - TEST_NAME="C C++ C# D Erlang Go Haxe (automake)" |
| 53 | BUILD_CMD="../autotools.sh" |
| 54 | BUILD_ARG="--without-dart --without-haskell --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] | 55 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 56 | - TEST_NAME="C C++ - GCC (automake)" |
| 57 | BUILD_CMD="../autotools.sh" |
| 58 | BUILD_ARG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-dart --without-ruby --without-haskell --without-go --without-haxe --without-d" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 59 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 60 | - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)" |
| 61 | BUILD_CMD="../autotools.sh" |
| 62 | BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 63 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 64 | # Tutorial build is unstable |
| 65 | - TEST_NAME="Dart (automake)" |
| 66 | BUILD_CMD="../autotools.sh" |
| 67 | BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --enable-tutorial=no" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 68 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 69 | # These are flaky and also have lengthy output |
| 70 | - TEST_NAME="Haskell Node.js (automake)" |
| 71 | BUILD_CMD="../autotools.sh" |
| 72 | BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-perl --without-php --without-php_extension --without-python --without-ruby" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 73 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 74 | # CMake build |
| 75 | - TEST_NAME="All" |
| 76 | BUILD_CMD="../cmake.sh" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 77 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 78 | - TEST_NAME="C C++ - GCC" |
| 79 | BUILD_CMD="../cmake.sh" |
| 80 | BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 81 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 82 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 83 | - TEST_NAME="C++ (Boost Thread)" |
| 84 | BUILD_CMD="../cmake.sh" |
| 85 | BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 86 | |
| 87 | - TEST_NAME="C++ (Boost Thread - GCC)" |
| 88 | BUILD_CMD="../cmake.sh" |
| 89 | BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 90 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 91 | |
| 92 | - TEST_NAME="C++ (Std Thread)" |
| 93 | BUILD_CMD="../cmake.sh" |
| 94 | BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 95 | |
| 96 | - TEST_NAME="C++ (Std Thread - GCC)" |
| 97 | BUILD_CMD="../cmake.sh" |
| 98 | BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 99 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 100 | |
| 101 | - TEST_NAME="Compiler (mingw)" |
| 102 | BUILD_CMD="../cmake.sh" |
| 103 | BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF" |
| 104 | BUILD_ENV="" |
| 105 | |
| 106 | - TEST_NAME="All (CentOS)" |
| 107 | BUILD_CMD="../cmake.sh" |
| 108 | DISTRO=centos |
| 109 | |
| 110 | - TEST_NAME="C C++ - GCC (CentOS)" |
| 111 | BUILD_CMD="../cmake.sh" |
| 112 | BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 113 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 114 | DISTRO=centos |
| 115 | |
Nobuaki Sukegawa | 33744b0 | 2016-01-03 14:24:39 +0900 | [diff] [blame^] | 116 | - TEST_NAME="Python 2.6 (CentOS 6)" |
| 117 | BUILD_CMD="../cmake.sh" |
| 118 | BUILD_ARG="-DWITH_PYTHON=ON -DWITH_CPP=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 119 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 120 | DISTRO=centos6 |
| 121 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 122 | # Distribution |
| 123 | - TEST_NAME="make dist" |
| 124 | BUILD_CMD="../make-dist.sh" |
| 125 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 126 | |
| 127 | - TEST_NAME="Debian Packages" |
| 128 | BUILD_CMD="../dpkg.sh" |
| 129 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 130 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 131 | matrix: |
| 132 | include: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 133 | # QA jobs for code analytics and metrics |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 134 | # |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 135 | # static code analysis with cppcheck |
| 136 | # add --error-exitcode=1 to --enable=all as soon as everything is fixed |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 137 | - env: TEST_NAME="cppcheck" |
| 138 | install: |
| 139 | - sudo apt-get update |
| 140 | - sudo apt-get install cppcheck |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 141 | script: |
| 142 | # Compiler cppcheck (All) |
| 143 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src |
| 144 | # C++ cppcheck (All) |
| 145 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 146 | # C Glib cppcheck (All) |
| 147 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
| 148 | # Silent error checks |
| 149 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src |
| 150 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 151 | - 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] | 152 | |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 153 | # search for TODO etc within source tree |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 154 | # some statistics about the code base |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 155 | # some info about the build machine |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 156 | - env: TEST_NAME="TODO FIXME HACK, LoC and system info" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 157 | install: |
| 158 | - sudo apt-get update |
| 159 | - sudo apt-get install sloccount |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 160 | script: |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 161 | - grep -r TODO * |
| 162 | - grep -r FIXME * |
| 163 | - grep -r HACK * |
| 164 | # LoC |
| 165 | - sloccount . |
| 166 | # System Info |
| 167 | - dpkg -l |
| 168 | - uname -a |