From 8224c437d780c89ac11a57a1500d372e7fc631d1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 24 Feb 2019 08:12:04 +0200 Subject: [PATCH] Move running tests in separate build job. This potensially can give speed optimization if travis shares cchace between build jobs. --HG-- branch : develop --- .travis.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ab416d19..cd1857f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,15 @@ language: cpp -matrix: +jobs: include: - - os: linux + - stage: "main test" + os: linux dist: trusty sudo: required compiler: clang env: - DEPLOY=false - CCACHE_CPP2=yes + - RUN_TESTS=true cache: - ccache directories: @@ -24,6 +26,19 @@ matrix: - DEPLOY=true - LEGACY=true osx_image: xcode8 + - stage: "sonarcloud" + os: linux + dist: trusty + sudo: required + compiler: clang + env: + - DEPLOY=false + - CCACHE_CPP2=yes + - RUN_TESTS=false + cache: + - ccache + directories: + - '$HOME/.sonar/cache' before_install: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then @@ -72,7 +87,11 @@ before_script: - qmake --version - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - qmake ../Valentina.pro -r -spec linux-clang CONFIG+=noDebugSymbols CONFIG+=checkWarnings CONFIG+=noTests; + if [[ "$RUN_TESTS" == "true" ]]; then + qmake ../Valentina.pro -r -spec linux-clang CONFIG+=noDebugSymbols CONFIG+=checkWarnings; + else + qmake ../Valentina.pro -r -spec linux-clang CONFIG+=noDebugSymbols CONFIG+=checkWarnings CONFIG+=noTests; + fi else qmake ../Valentina.pro -r CONFIG+=noDebugSymbols CONFIG+=no_ccache CONFIG+=checkWarnings CONFIG+=noTests; fi @@ -80,9 +99,15 @@ script: - $CXX --version - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - build-wrapper-linux-x86-64 --out-dir ../bw-outputs make -j$(nproc); - cd ..; - sonar-scanner; + if [[ "$RUN_TESTS" == "true" ]]; then + make -j$(nproc); + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$TRAVIS_BUILD_DIR/build/src/libs/vpropertyexplorer/bin:$TRAVIS_BUILD_DIR/build/src/libs/qmuparser/bin"; + xvfb-run -a make --silent check TESTARGS="-silent"; + else + build-wrapper-linux-x86-64 --out-dir ../bw-outputs make -j$(nproc); + cd ..; + sonar-scanner; + fi else make -j1; fi