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 | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 29 | - (travis_wait ./build/docker/check_unmodified.sh $DISTRO && touch .unmodified) || true |
| 30 | - if [ ! -f .unmodified ]; then travis_retry travis_wait docker build -q -t thrift-build:$DISTRO build/docker/$DISTRO; fi |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 31 | |
| 32 | script: |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 33 | - docker run --net=host -e BUILD_LIBS="$BUILD_LIBS" $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build:$DISTRO build/docker/scripts/$SCRIPT $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 | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 38 | - SCRIPT="cmake.sh" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 39 | - BUILD_ARG="" |
| 40 | - BUILD_ENV="-e CC=clang -e CXX=clang++" |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 41 | - DISTRO=ubuntu-xenial |
Nobuaki Sukegawa | c40018b | 2016-02-22 21:29:13 +0900 | [diff] [blame] | 42 | - 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] | 43 | |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 44 | matrix: |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 45 | - TEST_NAME="Cross Language Tests (Binary Protocol)" |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 46 | SCRIPT="cross-test.sh" |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 47 | BUILD_ARG="-'(binary)'" |
| 48 | BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
| 49 | |
| 50 | - TEST_NAME="Cross Language Tests (Header, JSON Protocols)" |
| 51 | SCRIPT="cross-test.sh" |
| 52 | BUILD_ARG="-'(header|json)'" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 53 | 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] | 54 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 55 | - TEST_NAME="Cross Language Tests (Compact and Multiplexed Protocols)" |
Nobuaki Sukegawa | 2c64bdd | 2016-09-04 15:33:40 +0900 | [diff] [blame] | 56 | SCRIPT="cross-test.sh" |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 57 | BUILD_ARG="-'(compact|multiplexed)'" |
Allen George | bc1344d | 2017-04-28 10:22:03 -0400 | [diff] [blame] | 58 | BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
| 59 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 60 | # Autotools builds |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 61 | # TODO: Remove them once migrated to CMake |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 62 | # centos-7.3 build jobs appear to be unstable/hang... |
| 63 | # TEST_NAME="Autotools (CentOS 7.3)" |
| 64 | # DISTRO=centos-7.3 |
| 65 | # SCRIPT="autotools.sh" |
| 66 | # BUILD_ENV="-e CC=gcc -e CXX=g++" |
| 67 | # BUILD_ARG="--without-cpp --without-csharp --without-c_glib --without-d -without-dart --without-erlang --without-go --without-haskell --without-haxe" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 68 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 69 | - TEST_NAME="Autotools (Ubuntu Xenial)" |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 70 | SCRIPT="autotools.sh" |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 71 | BUILD_ENV="-e CC=gcc -e CXX=g++" |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 72 | BUILD_ARG="--enable-plugin" # --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-py3 --without-ruby --without-rust" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 73 | |
James E. King, III | 4eb2347 | 2017-04-05 19:32:27 -0400 | [diff] [blame] | 74 | # CMake builds |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 75 | # centos-7.3 build jobs appear to be unstable/hang... |
| 76 | # TEST_NAME="CMake (CentOS 7.3)" |
| 77 | # DISTRO=centos-7.3 |
Roger Meier | 447294f | 2015-12-11 00:04:41 +0100 | [diff] [blame] | 78 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 79 | - TEST_NAME="CMake (Ubuntu Xenial)" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 80 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 81 | # C++ specific options: compiler plug-in, threading model |
| 82 | - TEST_NAME="C++ (Boost Thread)" |
Nobuaki Sukegawa | c40018b | 2016-02-22 21:29:13 +0900 | [diff] [blame] | 83 | BUILD_LIBS="CPP TESTING TUTORIALS" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 84 | BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 85 | |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 86 | - TEST_NAME="C++ (Std Thread) and Plugin" |
Nobuaki Sukegawa | c40018b | 2016-02-22 21:29:13 +0900 | [diff] [blame] | 87 | BUILD_LIBS="CPP TESTING TUTORIALS" |
James E. King, III | 4eb2347 | 2017-04-05 19:32:27 -0400 | [diff] [blame] | 88 | BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 89 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 90 | # Distribution |
| 91 | - TEST_NAME="make dist" |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 92 | SCRIPT="make-dist.sh" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 93 | |
| 94 | - TEST_NAME="Debian Packages" |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 95 | SCRIPT="dpkg.sh" |
Roger Meier | 447294f | 2015-12-11 00:04:41 +0100 | [diff] [blame] | 96 | |
Jim Apple | 147c284 | 2017-03-18 12:56:50 -0700 | [diff] [blame] | 97 | # C and C++ undefined behavior. This wraps autotools.sh, but each binary crashes if |
| 98 | # undefined behavior occurs. Skips the known flaky tests. |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 99 | # Unstable: THRIFT-4064 needs to be fixed perhaps? |
Jim Apple | 147c284 | 2017-03-18 12:56:50 -0700 | [diff] [blame] | 100 | - TEST_NAME="UBSan" |
| 101 | SCRIPT="ubsan.sh" |
James E. King, III | 4c30c15 | 2017-09-14 05:10:29 -0700 | [diff] [blame^] | 102 | BUILD_ARG="--without-haskell --without-nodejs --without-perl --without-python" |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 103 | UNSTABLE=true |
Jim Apple | 147c284 | 2017-03-18 12:56:50 -0700 | [diff] [blame] | 104 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 105 | matrix: |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 106 | allow_failures: |
| 107 | - env: UNSTABLE=true |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 108 | include: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 109 | # QA jobs for code analytics and metrics |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 110 | # |
Nobuaki Sukegawa | d479e23 | 2016-02-28 11:28:19 +0900 | [diff] [blame] | 111 | # C/C++ static code analysis with cppcheck |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 112 | # 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] | 113 | # |
| 114 | # Python code style check with flake8 |
| 115 | # |
| 116 | # search for TODO etc within source tree |
| 117 | # some statistics about the code base |
| 118 | # some info about the build machine |
| 119 | - env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 120 | install: |
Nobuaki Sukegawa | 3dd4d8e | 2016-03-01 01:26:56 +0900 | [diff] [blame] | 121 | - travis_retry sudo apt-get update |
| 122 | - travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8 |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 123 | script: |
| 124 | # Compiler cppcheck (All) |
| 125 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src |
| 126 | # C++ cppcheck (All) |
| 127 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 128 | # C Glib cppcheck (All) |
| 129 | - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib |
| 130 | # Silent error checks |
| 131 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src |
| 132 | - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp |
| 133 | - 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] | 134 | # Python code style |
| 135 | - flake8 --ignore=E501 lib/py |
| 136 | - flake8 tutorial/py |
| 137 | - flake8 --ignore=E501 test/py |
| 138 | - flake8 test/py.twisted |
| 139 | - flake8 test/py.tornado |
| 140 | - flake8 --ignore=E501 test/test.py |
| 141 | - flake8 --ignore=E501 test/crossrunner |
| 142 | - flake8 test/features |
| 143 | # TODO etc |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 144 | - grep -r TODO * |
| 145 | - grep -r FIXME * |
| 146 | - grep -r HACK * |
| 147 | # LoC |
| 148 | - sloccount . |
| 149 | # System Info |
| 150 | - dpkg -l |
| 151 | - uname -a |