mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
699b5bc47a
This closes #1359
151 lines
5.8 KiB
YAML
151 lines
5.8 KiB
YAML
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
|
|
# build Apache Thrift on Travis CI - https://travis-ci.org/
|
|
|
|
sudo: required
|
|
dist: trusty
|
|
|
|
services:
|
|
- docker
|
|
|
|
install:
|
|
- (travis_wait ./build/docker/check_unmodified.sh $DISTRO && touch .unmodified) || true
|
|
- if [ ! -f .unmodified ]; then travis_retry travis_wait docker build -q -t thrift-build:$DISTRO build/docker/$DISTRO; fi
|
|
|
|
script:
|
|
- 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
|
|
|
|
env:
|
|
global:
|
|
- TEST_NAME=""
|
|
- SCRIPT="cmake.sh"
|
|
- BUILD_ARG=""
|
|
- BUILD_ENV="-e CC=clang -e CXX=clang++"
|
|
- DISTRO=ubuntu-xenial
|
|
- BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
|
|
|
|
matrix:
|
|
- TEST_NAME="Cross Language Tests (Binary Protocol)"
|
|
SCRIPT="cross-test.sh"
|
|
BUILD_ARG="-'(binary)'"
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
- TEST_NAME="Cross Language Tests (Header, JSON Protocols)"
|
|
SCRIPT="cross-test.sh"
|
|
BUILD_ARG="-'(header|json)'"
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
- TEST_NAME="Cross Language Tests (Compact and Multiplexed Protocols)"
|
|
SCRIPT="cross-test.sh"
|
|
BUILD_ARG="-'(compact|multiplexed)'"
|
|
BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
|
|
|
|
# Autotools builds
|
|
# TODO: Remove them once migrated to CMake
|
|
# centos-7.3 build jobs appear to be unstable/hang...
|
|
# TEST_NAME="Autotools (CentOS 7.3)"
|
|
# DISTRO=centos-7.3
|
|
# SCRIPT="autotools.sh"
|
|
# BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
# BUILD_ARG="--without-cpp --without-csharp --without-c_glib --without-d -without-dart --without-erlang --without-go --without-haskell --without-haxe"
|
|
|
|
- TEST_NAME="Autotools (Ubuntu Xenial)"
|
|
SCRIPT="autotools.sh"
|
|
BUILD_ENV="-e CC=gcc -e CXX=g++"
|
|
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"
|
|
|
|
# CMake builds
|
|
# centos-7.3 build jobs appear to be unstable/hang...
|
|
# TEST_NAME="CMake (CentOS 7.3)"
|
|
# DISTRO=centos-7.3
|
|
|
|
- TEST_NAME="CMake (Ubuntu Xenial)"
|
|
|
|
# C++ specific options: compiler plug-in, threading model
|
|
- TEST_NAME="C++ (Boost Thread)"
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
|
BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
- TEST_NAME="C++ (Std Thread) and Plugin"
|
|
BUILD_LIBS="CPP TESTING TUTORIALS"
|
|
BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
|
|
|
|
# Distribution
|
|
- TEST_NAME="make dist"
|
|
SCRIPT="make-dist.sh"
|
|
|
|
- TEST_NAME="Debian Packages"
|
|
SCRIPT="dpkg.sh"
|
|
|
|
# C and C++ undefined behavior. This wraps autotools.sh, but each binary crashes if
|
|
# undefined behavior occurs. Skips the known flaky tests.
|
|
- TEST_NAME="UBSan"
|
|
SCRIPT="ubsan.sh"
|
|
BUILD_ARG="--without-haskell --without-nodejs --without-perl --without-python"
|
|
UNSTABLE=true
|
|
|
|
matrix:
|
|
allow_failures:
|
|
- env: UNSTABLE=true
|
|
include:
|
|
# QA jobs for code analytics and metrics
|
|
#
|
|
# C/C++ static code analysis with cppcheck
|
|
# add --error-exitcode=1 to --enable=all as soon as everything is fixed
|
|
#
|
|
# Python code style check with flake8
|
|
#
|
|
# search for TODO etc within source tree
|
|
# some statistics about the code base
|
|
# some info about the build machine
|
|
- env: TEST_NAME="cppcheck, flake8, TODO FIXME HACK, LoC and system info"
|
|
install:
|
|
- travis_retry sudo apt-get update
|
|
- travis_retry sudo apt-get install -ym cppcheck sloccount python-flake8
|
|
script:
|
|
# Compiler cppcheck (All)
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
|
|
# C++ cppcheck (All)
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
|
|
# C Glib cppcheck (All)
|
|
- cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
|
|
# Silent error checks
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
|
|
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
|
|
# Python code style
|
|
- flake8 --ignore=E501 lib/py
|
|
- flake8 tutorial/py
|
|
- flake8 --ignore=E501 test/py
|
|
- flake8 test/py.twisted
|
|
- flake8 test/py.tornado
|
|
- flake8 --ignore=E501 test/test.py
|
|
- flake8 --ignore=E501 test/crossrunner
|
|
- flake8 test/features
|
|
# TODO etc
|
|
- grep -r TODO *
|
|
- grep -r FIXME *
|
|
- grep -r HACK *
|
|
# LoC
|
|
- sloccount .
|
|
# System Info
|
|
- dpkg -l
|
|
- uname -a
|