<commit_before>#
# 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

services:
  - docker

install:
  - docker pull thrift/$DISTRO:latest || true
  - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
  - docker build -q -t thrift-build build/docker/$DISTRO

script:
  - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG

env:
  global:
    - TEST_NAME=""
    - BUILD_CMD="none"
    - BUILD_ARG=""
    - BUILD_ENV="-e CC=clang -e CXX=clang++"
    - DISTRO=ubuntu

  matrix:
    # TODO: Break up by protocol types to avoid 50min limit
    - TEST_NAME="Cross Language Tests"
      BUILD_CMD="../cross-test.sh"
      BUILD_ARG="--enable-tutorial=no"
      BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    # TODO: Remove them once migrated to CMake
    # Autotools builds
    - TEST_NAME="C C++ C# D Erlang Go Haxe (automake)"
      BUILD_CMD="../autotools.sh"
      BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"

    - TEST_NAME="C C++ - GCC (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)"
      BUILD_CMD="../autotools.sh"
      BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe"

    # Tutorial build is unstable
    - TEST_NAME="Dart (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    # These are flaky and also have lengthy output
    - TEST_NAME="Haskell Node.js (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    # CMake build
    - TEST_NAME="All"
      BUILD_CMD="../cmake.sh"

    - TEST_NAME="C C++ - GCC"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="C++ (Boost Thread)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"

    - TEST_NAME="C++ (Boost Thread - GCC)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="C++ (Std Thread)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"

    - TEST_NAME="C++ (Std Thread - GCC)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="Compiler (mingw)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
      BUILD_ENV=""

    - TEST_NAME="All (CentOS)"
      BUILD_CMD="../cmake.sh"
      DISTRO=centos

    - TEST_NAME="C C++ - GCC (CentOS)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"
      DISTRO=centos

    # Distribution
    - TEST_NAME="make dist"
      BUILD_CMD="../make-dist.sh"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="Debian Packages"
      BUILD_CMD="../dpkg.sh"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

matrix:
  allow_failures:
    - env: TEST_NAME="All (CentOS)" BUILD_CMD="../cmake.sh" DISTRO=centos

  include:
    # QA jobs for code analytics and metrics
    #
    # static code analysis with cppcheck
    # add --error-exitcode=1 to --enable=all as soon as everything is fixed
    - env: TEST_NAME="cppcheck"
      install:
        - sudo apt-get update
        - sudo apt-get install cppcheck
      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<commit_msg>Remove Travis-CI allow_failures entry for CentOS 7<commit_after>#
# 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

services:
  - docker

install:
  - docker pull thrift/$DISTRO:latest || true
  - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
  - docker build -q -t thrift-build build/docker/$DISTRO

script:
  - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG

env:
  global:
    - TEST_NAME=""
    - BUILD_CMD="none"
    - BUILD_ARG=""
    - BUILD_ENV="-e CC=clang -e CXX=clang++"
    - DISTRO=ubuntu

  matrix:
    # TODO: Break up by protocol types to avoid 50min limit
    - TEST_NAME="Cross Language Tests"
      BUILD_CMD="../cross-test.sh"
      BUILD_ARG="--enable-tutorial=no"
      BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    # TODO: Remove them once migrated to CMake
    # Autotools builds
    - TEST_NAME="C C++ C# D Erlang Go Haxe (automake)"
      BUILD_CMD="../autotools.sh"
      BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"

    - TEST_NAME="C C++ - GCC (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)"
      BUILD_CMD="../autotools.sh"
      BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe"

    # Tutorial build is unstable
    - TEST_NAME="Dart (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    # These are flaky and also have lengthy output
    - TEST_NAME="Haskell Node.js (automake)"
      BUILD_CMD="../autotools.sh"
      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"

    # CMake build
    - TEST_NAME="All"
      BUILD_CMD="../cmake.sh"

    - TEST_NAME="C C++ - GCC"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="C++ (Boost Thread)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"

    - TEST_NAME="C++ (Boost Thread - GCC)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="C++ (Std Thread)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"

    - TEST_NAME="C++ (Std Thread - GCC)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="Compiler (mingw)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
      BUILD_ENV=""

    - TEST_NAME="All (CentOS)"
      BUILD_CMD="../cmake.sh"
      DISTRO=centos

    - TEST_NAME="C C++ - GCC (CentOS)"
      BUILD_CMD="../cmake.sh"
      BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
      BUILD_ENV="-e CC=gcc -e CXX=g++"
      DISTRO=centos

    # Distribution
    - TEST_NAME="make dist"
      BUILD_CMD="../make-dist.sh"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

    - TEST_NAME="Debian Packages"
      BUILD_CMD="../dpkg.sh"
      BUILD_ENV="-e CC=gcc -e CXX=g++"

matrix:
  include:
    # QA jobs for code analytics and metrics
    #
    # static code analysis with cppcheck
    # add --error-exitcode=1 to --enable=all as soon as everything is fixed
    - env: TEST_NAME="cppcheck"
      install:
        - sudo apt-get update
        - sudo apt-get install cppcheck
      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
{'fraction_non_alphanumeric': 0.14524083511425284, 'fraction_numerical': 0.0032056551043892815, 'mean_word_length': 2.903432787937119, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '164591', 'n_tokens_mistral': 4441, 'n_tokens_neox': 4166, 'n_words': 977}