From 21491bbf6b54aaeda8b089334842968c69d699fd Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 16 Mar 2017 16:42:42 +0100 Subject: [PATCH] travis: use codecov instead of coveralls --- .travis.yml | 10 ++++++++-- scripts/travis-build.sh | 30 +++++------------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 282d13c..05b1a1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ _anchors: matrix: include: - # Linux GCC-4.6 debug coveralls + # Linux GCC-4.6 debug tests_coverage - compiler: gcc - env: TRAVIS_BUILD_TYPE=Debug TRAVIS_COVERALLS=ON + env: TRAVIS_BUILD_TYPE=Debug TRAVIS_TESTS_COVERAGE=ON # Linux GCC-4.6 debug google_double-conversion - compiler: gcc env: TRAVIS_BUILD_TYPE=Debug TRAVIS_FLOAT2STR_LIB=google_doubleconversion @@ -39,3 +39,9 @@ matrix: script: - chmod +x scripts/travis-build.sh - ./scripts/travis-build.sh + +after_success: + - | + if [ "$TRAVIS_TESTS_COVERAGE" = "ON" ]; then + bash <(curl -s https://codecov.io/bash); + fi diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh index a7a086d..0401667 100644 --- a/scripts/travis-build.sh +++ b/scripts/travis-build.sh @@ -3,24 +3,16 @@ # Make the script fails on any command error set -e -# Install cpp-coveralls only if OS==linux and CC==gcc -if [ "${TRAVIS_COVERALLS}" = "ON" ] \ - && [ "${TRAVIS_OS_NAME}" = "linux" ] \ - && [ "${CC}" = "gcc" ]; -then - export PYTHONUSERBASE=`pwd`/pip; - pip install --user cpp-coveralls; -else - export TRAVIS_COVERALLS=OFF; -fi -echo TRAVIS_COVERALLS=$TRAVIS_COVERALLS - # CMake options as environment variables if [ -n "${TRAVIS_GCC_VERSION}" ]; then export CC=gcc-$TRAVIS_GCC_VERSION; export CXX=g++-$TRAVIS_GCC_VERSION; fi +if [ -z "${TRAVIS_TESTS_COVERAGE}" ]; then + export TRAVIS_TESTS_COVERAGE=OFF; +fi + if [ -z "${TRAVIS_FLOAT2STR_LIB}" ]; then export TRAVIS_FLOAT2STR_LIB=std; fi @@ -38,22 +30,10 @@ cmake .. -G "Unix Makefiles" \ -DGMIO_BUILD_BENCHMARK_ASSIMP=OFF \ -DGMIO_BUILD_BENCHMARK_OPENCASCADE=OFF \ -DGMIO_BUILD_TESTS_FAKE_SUPPORT=ON \ - -DGMIO_BUILD_TESTS_COVERAGE=$TRAVIS_COVERALLS \ + -DGMIO_BUILD_TESTS_COVERAGE=$TRAVIS_TESTS_COVERAGE \ -DGMIO_FLOAT2STR_LIB=$TRAVIS_FLOAT2STR_LIB # Make make -j4 VERBOSE=1 make install make check # Unit tests - -# Coveralls -if [ "${TRAVIS_COVERALLS}" = "ON" ]; then - $PYTHONUSERBASE/bin/coveralls \ - --exclude benchmarks \ - --exclude build/CMakeFiles \ - --exclude examples \ - --exclude install \ - --exclude tests \ - --gcov-options '\-lp' \ - --root .. --build-root . ; -fi