From b36dfe4e94cdf923783c827be8fa6f76c39dfc22 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 23 Jul 2019 23:04:59 +0100 Subject: [PATCH] Upgrade OS on Travis: One build is now on 18.04, the rest are on 16.04 Get coverage from linux llvm builds --- .travis.yml | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1785f7f4..40382a3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,18 +10,15 @@ env: # These linux-specific parameters could be moved into matrix.include items, but that's lots of repetition sudo: required -dist: trusty +dist: xenial services: - docker -# See https://github.com/google/sanitizers/issues/856 -group: deprecated-2017Q3 - -# TODO: add Linux LLVM coverage; clang 3.5.0 on ubuntu trusty is too old. matrix: fast_finish: true include: - os: linux + dist: bionic compiler: gcc env: BUILD_TYPE=normal BUILD_WITH=cmake COVERAGE=gcov - os: linux @@ -29,10 +26,10 @@ matrix: env: BUILD_TYPE=normal BUILD_WITH=autoconf COVERAGE=gcov - os: linux compiler: clang - env: BUILD_TYPE=asan BUILD_WITH=cmake COVERAGE=no + env: BUILD_TYPE=asan BUILD_WITH=cmake COVERAGE=gcov - os: linux compiler: clang - env: BUILD_TYPE=tsan BUILD_WITH=cmake COVERAGE=no + env: BUILD_TYPE=tsan BUILD_WITH=cmake COVERAGE=gcov - os: osx osx_image: xcode8.3 # macOS 10.12 compiler: clang @@ -103,17 +100,9 @@ before_install: install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cat /proc/cpuinfo /proc/meminfo; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then lsb_release -a; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:teward/swig3.0; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:beineri/opt-qt551-trusty; fi # default qt5.2 from trusty doesn't support QByteArray::toStdString() - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_WITH" == "cmake" ]]; then sudo add-apt-repository -y ppa:george-edison55/cmake-3.x; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libperl-dev tcl-dev libsasl2-dev libicu-dev swig3.0 qt55base libboost-locale-dev; fi - # Clang 3.5 TSan is broken on Travis Ubuntu 14.04. Clang 3.8 seems to work, but only without -pie (https://github.com/google/sanitizers/issues/503) - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "tsan" ]]; then sudo apt-get install -y clang-3.8; export CC=clang-3.8 CXX=clang++-3.8; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source /opt/qt55/bin/qt55-env.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libperl-dev tcl-dev libsasl2-dev libicu-dev swig3.0 qt5-default libboost-locale-dev python3-pip; fi - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_WITH" == "cmake" ]]; then sudo apt-get install -y cmake; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source ~/virtualenv/python3.5/bin/activate; fi # for pip3 - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PKG_CONFIG_PATH="/opt/python/3.5/lib/pkgconfig:$PKG_CONFIG_PATH" LD_LIBRARY_PATH="/opt/python/3.5/lib:$LD_LIBRARY_PATH"; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib); fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cpanm --notest Devel::Cover::Report::Clover; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export ZNC_MODPERL_COVERAGE=1; fi @@ -150,13 +139,14 @@ script: after_success: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ~/perl5/bin/cover --no-gcov --report=clover; fi - | - if [[ "$TRAVIS_OS_NAME" == "osx" && "$COVERAGE" == "llvm" ]]; then - xcrun llvm-profdata merge unittest.profraw -o unittest.profdata - xcrun llvm-profdata merge inttest.profraw -o inttest.profdata - xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt - xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata unittest > unittest-autoconf-coverage.txt - xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt - find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done + if [[ "$COVERAGE" == "llvm" ]]; then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then llvm-profdata() { xcrun llvm-profdata "$@"; }; llvm-cov() { xcrun llvm-cov "$@"; }; fi + llvm-profdata merge unittest.profraw -o unittest.profdata + llvm-profdata merge inttest.profraw -o inttest.profdata + llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt + llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata unittest > unittest-autoconf-coverage.txt + llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt + find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done fi - bash <(curl -s https://codecov.io/bash) notifications: