blob: 443960bee9708efb77902ba82861cf57b75fad82 [file] [log] [blame]
Roger Meiera0836f62013-05-05 00:19:38 +02001#
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çaaba4b1f2015-06-26 20:56:18 +100022sudo: required
Nobuaki Sukegawad479e232016-02-28 11:28:19 +090023dist: trusty
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100024
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090025services:
26 - docker
Roger Meiera0836f62013-05-05 00:19:38 +020027
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090028install:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090029 - (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 Sukegawaa10697a2014-12-21 19:43:22 +090031
32script:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090033 - 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 Meier7ed94ef2015-04-26 16:55:35 +020034
henriqueac8d8e22014-07-23 23:31:04 +020035env:
Roger Meier5effab62014-11-16 22:31:33 +010036 global:
37 - TEST_NAME=""
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090038 - SCRIPT="cmake.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090039 - BUILD_ARG=""
40 - BUILD_ENV="-e CC=clang -e CXX=clang++"
James E. King, IIId7142b72017-09-01 13:00:36 -070041 - DISTRO=ubuntu-xenial
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090042 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
henriquec0a7d722014-07-26 13:11:12 +020043
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090044 matrix:
James E. King, IIId7142b72017-09-01 13:00:36 -070045 - TEST_NAME="Cross Language Tests (Binary, Header, JSON Protocols)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090046 SCRIPT="cross-test.sh"
James E. King, IIId7142b72017-09-01 13:00:36 -070047 BUILD_ARG="-'(binary|header|json)'"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090048 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Roger Meier41ad4342015-03-24 22:30:40 +010049
James E. King, IIId7142b72017-09-01 13:00:36 -070050 - TEST_NAME="Cross Language Tests (Compact and Multiplexed Protocols)"
Nobuaki Sukegawa2c64bdd2016-09-04 15:33:40 +090051 SCRIPT="cross-test.sh"
James E. King, IIId7142b72017-09-01 13:00:36 -070052 BUILD_ARG="-'(compact|multiplexed)'"
Allen Georgebc1344d2017-04-28 10:22:03 -040053 BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
54
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090055 # Autotools builds
James E. King, IIId7142b72017-09-01 13:00:36 -070056 # TODO: Remove them once migrated to CMake
57 - TEST_NAME="Autotools (CentOS 7.3)"
58 DISTRO=centos-7.3
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090059 SCRIPT="autotools.sh"
Nobuaki Sukegawaea5845a2016-02-14 21:56:53 +090060 BUILD_ENV="-e CC=gcc -e CXX=g++"
James E. King, IIId7142b72017-09-01 13:00:36 -070061 BUILD_ARG="--without-cpp --without-csharp --without-c_glib --without-d -without-dart --without-erlang --without-go --without-haskell --without-haxe"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090062
James E. King, IIId7142b72017-09-01 13:00:36 -070063 - TEST_NAME="Autotools (Ubuntu Xenial)"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090064 SCRIPT="autotools.sh"
James E. King, IIId7142b72017-09-01 13:00:36 -070065 BUILD_ENV="-e CC=gcc -e CXX=g++"
66 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 Sukegawae58ed1a2015-11-23 19:23:43 +090067
James E. King, III4eb23472017-04-05 19:32:27 -040068 # CMake builds
James E. King, IIId7142b72017-09-01 13:00:36 -070069 - TEST_NAME="CMake (CentOS 7.3)"
70 DISTRO=centos-7.3
Roger Meier447294f2015-12-11 00:04:41 +010071
James E. King, IIId7142b72017-09-01 13:00:36 -070072 - TEST_NAME="CMake (Ubuntu Xenial)"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090073
James E. King, IIId7142b72017-09-01 13:00:36 -070074 # C++ specific options: compiler plug-in, threading model
75 - TEST_NAME="C++ (Boost Thread)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090076 BUILD_LIBS="CPP TESTING TUTORIALS"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090077 BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090078
James E. King, III4eb23472017-04-05 19:32:27 -040079 - TEST_NAME="C++ Plugin (Std Thread)"
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090080 BUILD_LIBS="CPP TESTING TUTORIALS"
James E. King, III4eb23472017-04-05 19:32:27 -040081 BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090082
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090083 # Distribution
84 - TEST_NAME="make dist"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090085 SCRIPT="make-dist.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090086
87 - TEST_NAME="Debian Packages"
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090088 SCRIPT="dpkg.sh"
Roger Meier447294f2015-12-11 00:04:41 +010089
Jim Apple147c2842017-03-18 12:56:50 -070090 # C and C++ undefined behavior. This wraps autotools.sh, but each binary crashes if
91 # undefined behavior occurs. Skips the known flaky tests.
92 - TEST_NAME="UBSan"
93 SCRIPT="ubsan.sh"
94 BUILD_ARG="--without-haskell --without-nodejs --without-perl --without-python"
95
henriqueac8d8e22014-07-23 23:31:04 +020096matrix:
97 include:
Roger Meier5effab62014-11-16 22:31:33 +010098 # QA jobs for code analytics and metrics
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090099 #
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900100 # C/C++ static code analysis with cppcheck
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900101 # add --error-exitcode=1 to --enable=all as soon as everything is fixed
Nobuaki Sukegawad479e232016-02-28 11:28:19 +0900102 #
103 # Python code style check with flake8
104 #
105 # search for TODO etc within source tree
106 # some statistics about the code base
107 # some info about the build machine
108 - env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900109 install:
Nobuaki Sukegawa3dd4d8e2016-03-01 01:26:56 +0900110 - travis_retry sudo apt-get update
111 - travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900112 script:
113 # Compiler cppcheck (All)
114 - cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
115 # C++ cppcheck (All)
116 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
117 # C Glib cppcheck (All)
118 - cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
119 # Silent error checks
120 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
121 - cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
122 - 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 Sukegawad479e232016-02-28 11:28:19 +0900123 # Python code style
124 - flake8 --ignore=E501 lib/py
125 - flake8 tutorial/py
126 - flake8 --ignore=E501 test/py
127 - flake8 test/py.twisted
128 - flake8 test/py.tornado
129 - flake8 --ignore=E501 test/test.py
130 - flake8 --ignore=E501 test/crossrunner
131 - flake8 test/features
132 # TODO etc
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900133 - grep -r TODO *
134 - grep -r FIXME *
135 - grep -r HACK *
136 # LoC
137 - sloccount .
138 # System Info
139 - dpkg -l
140 - uname -a