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