.travis.yml
# Travis-CI build script for KaHyPar
language: cpp
# Ubuntu 14.04 Trusty support
sudo: false
dist: bionic
addons:
matrix:
include:
# gcc 9 - Debug Build
- env: CMAKE_CC="gcc-9" CMAKE_CXX="g++-9" BUILD_TYPE="Debug" COV="OFF" SONAR="OFF"
os: linux
addons: &gcc9
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- gcovr
- cppcheck
- libpython3-all-dev
sonarcloud:
organization: "sebastianschlag-github"
before_install:
- sudo add-apt-repository -y ppa:mhier/libboost-latest
- sudo apt-get -q update
- sudo apt-get -y install libboost1.70-dev
# gcc 9 - Release Build
- env: CMAKE_CC="gcc-9" CMAKE_CXX="g++-9" BUILD_TYPE="Release" COV="OFF" SONAR="OFF"
os: linux
addons: *gcc9
before_install:
- sudo add-apt-repository -y ppa:mhier/libboost-latest
- sudo apt-get -q update
- sudo apt-get -y install libboost1.70-dev
# gcc 9 - CodeCov
- env: CMAKE_CC="gcc-7" CMAKE_CXX="g++-7" BUILD_TYPE="Debug" COV="ON" SONAR="OFF"
os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- lcov
- gcovr
- cppcheck
- libpython3-all-dev
before_install:
- sudo add-apt-repository -y ppa:mhier/libboost-latest
- sudo apt-get -q update
- sudo apt-get -y install libboost1.70-dev
# gcc 9 - SonarCube
- env: CMAKE_CC="gcc-9" CMAKE_CXX="g++-9" BUILD_TYPE="Debug" COV="OFF" SONAR="ON"
os: linux
addons: *gcc9
before_install:
- sudo add-apt-repository -y ppa:mhier/libboost-latest
- sudo apt-get -q update
- sudo apt-get -y install libboost1.70-dev
# clang 3.7 on MacOSX
#- env: CMAKE_CC="clang" CMAKE_CXX="clang++" BUILD_TYPE="Debug" COV="OFF"
# os: osx
# before_install:
# - brew update
# - HOMEBREW_NO_AUTO_UPDATE=1 brew install cppcheck
#- env: CMAKE_CC="clang" CMAKE_CXX="clang++" BUILD_TYPE="Release" COV="OFF"
# os: osx
# before_install:
# - brew update
# - HOMEBREW_NO_AUTO_UPDATE=1 brew install cppcheck
install:
- export DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- echo ${TRAVIS_OS_NAME}
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
export CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.tar.gz";
mkdir cmake;
travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake;
export PATH=${DEPS_DIR}/cmake/bin:${PATH};
echo ${PATH};
else
brew install cmake || brew upgrade cmake;
fi
- cmake --version
before_script:
# print out some version numbers
- $CMAKE_CXX --version
# configure
- cd "${TRAVIS_BUILD_DIR}"
- mkdir build; cp sonar-project.properties build; cd build
- export TRAVIS_ENV=1
- if [ "$BUILD_TYPE" = "Debug" ]; then export PREPROC_ASSERT=0; else PREPROC_ASSERT=1; fi
- echo "PREPROC_ASSERT=$PREPROC_ASSERT"
- cmake
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DKAHYPAR_ENABLE_HEAVY_PREPROCESSING_ASSERTIONS="$PREPROC_ASSERT"
-DCMAKE_C_COMPILER="$CMAKE_CC" -DCMAKE_CXX_COMPILER="$CMAKE_CXX" -DKAHYPAR_USE_GCOV="$COV"
-DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS"
$CMAKE_ARGS ..
script:
- |
if [ "$BUILD_TYPE" = "Debug" ] && [ "$CMAKE_CXX" = "g++-9" ] && [ "$COV" = "OFF" ]; then
make clean all;
elif [ "$BUILD_TYPE" = "Debug" ] && [ "$CMAKE_CXX" = "g++-7" ] && [ "$COV" = "ON" ]; then
make clean all;
lcov --directory . --capture --output-file coverage.info;
lcov --remove coverage.info '/usr/*' --output-file coverage.info;
lcov --list coverage.info;
gcovr -r ../ -x > report.xml;
elif [ "$BUILD_TYPE" = "Debug" ] && [ "$CMAKE_CXX" = "g++-9" ] && [ "$SONAR" = "ON" ]; then
build-wrapper-linux-x86-64 --out-dir bw-output make clean all;
sonar-scanner;
elif [ "$BUILD_TYPE" = "Release" ] && [ "$CMAKE_CXX" = "g++-9" ]; then
build-wrapper-linux-x86-64 --out-dir bw-output make integration_tests; sonar-scanner;
../scripts/run_regression_tests.sh;
else
make clean all;
fi
after_success:
- |
if [ "$BUILD_TYPE" = "Debug" ] && [ "$CMAKE_CXX" = "g++-7" ] && [ "$COV" = "ON" ]; then
cd ${TRAVIS_BUILD_DIR};
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports";
fi
#cache:
# directories:
# - '$HOME/.sonar/cache'
#language: ruby
#rvm:
# - 2.4
#script:
# - "bundle install"
# - "bundle exec jekyll build"