#------------#
# Tomato #
#------------#
language: cpp
dist: trusty
os:
- linux
- osx
compiler:
- gcc
# - clang
# Blacklist the documentation branch
branches:
except:
- gh-pages
# Environment variables
env:
matrix:
- CXX_STANDARD=98
# - CXX_STANDARD=11
global:
- GH_REPO_NAME: Tomato # used in documentation script
- DOXYFILE: $TRAVIS_BUILD_DIR/Doxyfile # used in documentation script
- INPUT_FOR_DOXY: "'. ./app ./lib ./tests'" # used in documentation script
- OUTPUT_FOR_DOXY: "${TRAVIS_BUILD_DIR}/code_docs/${GH_REPO_NAME}" # used in documentation script
- GH_REPO_REF: github.com/MRKonrad/Tomato.git # used in documentation script
- EXTENDED_BUILD: "OFF"
- DEPLOY_BUILD: "OFF"
- secure: ${GH_PERSONAL_ACCESS_TOKEN}
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
- lcov
before_install:
# condition for the extended build (with coverage and documentation)
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "g++" ] && [ "$CXX_STANDARD" == "98" ]; then
EXTENDED_BUILD="ON";
fi
# condition for the deployment build
- if [ "$CXX" == "g++" ] && [ "$CXX_STANDARD" == "98" ]; then
export DEPLOY_BUILD="ON";
fi
# zip the data used for deployment
- cd ${TRAVIS_BUILD_DIR}/tests/testData
- zip -r testData.zip dicom
- zip -r testData.zip tomatoConfig_Shmolli_inputFilePaths.yaml
# - zip -r testData.zip tomatoConfig_Shmolli_inputDirPaths.yaml
install:
# install coverage tools only in linux g++
- if [ "$EXTENDED_BUILD" == "ON" ]; then
sudo pip install codecov;
fi
script:
#-----------------------#
# Tomato opensource #
#-----------------------#
# configure and generate opensource
- mkdir ${TRAVIS_BUILD_DIR}/opensource;
- cd ${TRAVIS_BUILD_DIR}/opensource;
- >-
cmake ..
-DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/opensource_install
-DCMAKE_CXX_STANDARD=${CXX_STANDARD}
-DCMAKE_MACOSX_RPATH=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
# build opensource
- cmake --build . --config RELEASE
- cmake --build . --config RELEASE --target install
#-----------------#
# Tomato full #
#-----------------#
# download tomato_private
- cd ${TRAVIS_BUILD_DIR}/..
- git clone https://MRKonrad:${GH_PERSONAL_ACCESS_TOKEN}@github.com/MRKonrad/tomato_private
# add coverage option (only in linux g++)
- if [ "$EXTENDED_BUILD" == "ON" ]; then
cd ${TRAVIS_BUILD_DIR}/opensource
cmake .. -DCMAKE_CXX_FLAGS="--coverage" ;
fi
# configure and generate full
- mkdir ${TRAVIS_BUILD_DIR}/full;
- cd ${TRAVIS_BUILD_DIR}/full;
- >-
cmake ..
-DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/full_install
-DCMAKE_CXX_STANDARD=${CXX_STANDARD}
-DCMAKE_MACOSX_RPATH=ON
-DUSE_PRIVATE_NR2=ON
# build full
- cmake --build . --config RELEASE
- cmake --build . --config RELEASE --target install
# testing and getting the test coverage
- cd ${TRAVIS_BUILD_DIR}/opensource_install/tests
- ./TomatoTests
- cd ${TRAVIS_BUILD_DIR}/full_install/tests
- ./TomatoTests
after_success:
# Run coverage analysis only in linux g++. Eval because travis wants to parse -- as part of yaml block
- if [ "$EXTENDED_BUILD" == "ON" ]; then
cd ${TRAVIS_BUILD_DIR}/full ;
cp ${TRAVIS_BUILD_DIR}/scriptsBuild/generateTestCoverageReport.sh generateTestCoverageReport.sh;
sh generateTestCoverageReport.sh;
ls;
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports" ;
fi
# Generate and deploy documentation only in linux g++
- if [ "$EXTENDED_BUILD" == "ON" ]; then
cd ${TRAVIS_BUILD_DIR} ;
cp ${TRAVIS_BUILD_DIR}/scriptsBuild/generateDocumentationAndDeploy.sh generateDocumentationAndDeploy.sh;
chmod +x generateDocumentationAndDeploy.sh;
./generateDocumentationAndDeploy.sh;
fi
# getting directories and variables ready for deployment
- mkdir ${TRAVIS_BUILD_DIR}/deployment
- export opensource_extended_name=TomatoOpenSource_${TRAVIS_BRANCH}_${TRAVIS_OS_NAME} # just a variable
- export full_extended_name=TomatoFull_${TRAVIS_BRANCH}_${TRAVIS_OS_NAME} # just a variable
# prepare to deploy TomatoOpenSource
- cd ${TRAVIS_BUILD_DIR}/opensource_install
- zip -r ${opensource_extended_name}.zip lib/libTomatoLib*
- zip -r ${opensource_extended_name}.zip include
- zip -r ${opensource_extended_name}.zip bin
# prepare to deploy TomatoFull
- cd ${TRAVIS_BUILD_DIR}/full_install
- zip -r ${full_extended_name}.zip lib/libTomatoLib*
- zip -r ${full_extended_name}.zip include
- zip -r ${full_extended_name}.zip bin
# copy the archives
- cp ${TRAVIS_BUILD_DIR}/opensource_install/${opensource_extended_name}.zip ${TRAVIS_BUILD_DIR}/deployment/
- cp ${TRAVIS_BUILD_DIR}/full_install/${full_extended_name}.zip ${TRAVIS_BUILD_DIR}/deployment/
- cp ${TRAVIS_BUILD_DIR}/tests/testData/testData.zip ${TRAVIS_BUILD_DIR}/deployment/testData.zip
- ls ${TRAVIS_BUILD_DIR}/deployment
- cd ${TRAVIS_BUILD_DIR} # needed for deployment!!!
deploy:
provider: releases
api_key:
secure: ${GH_PERSONAL_ACCESS_TOKEN}
file_glob: true
file: deployment/*
skip_cleanup: true
overwrite: true
on:
tags: true
condition: ${DEPLOY_BUILD} == "ON" # I guess I have to pick one compiler
notifications:
slack:
rooms:
- secure: ljyKu/sP6Ha9o4lZejENiPEhhVL1xQ86YTvywg7/jOSIV7xXy2xDULz6qsZxAi6TcGgPTLGQzb2ydFnHfe5bThW9klOzxTw8Ru+/DfDiPSk3mV3ylVDO6gcwCqoWbc63HGub90wRaEc1mLfp8NAnCq2nOayT7eHBzS2ABKNd0SwS9onaDnbOIIoXdZYw1z1mvOWrUrFErFHv8jeQ0l1MEOWaGGzttpZXB+ZwHOlaSACBCcNH6ZYZqUs9nsyBDa33GI4ktgIlkCeMahsix8ZbaoSE0rWXq5AvO93DhyjPUI3obFHysjI2eQSnMU652ASWOAqMVoHCGSURSvOobCEbVq2OmYfq77UF+ntS2rdQccKE4DEC8A2YN9xNY3H+Coiw2C+NadETxixp0n0byPBUBopg7Jb3iGj76KuEpk5qVzu4xCwJiRPek9o5t8v34+y979Xn9e4wnMN4sN8xS364qU/innBJkZgbYtXolFhX/GA5gglA3PZVq5XdMs16sWxwrG0uRgSsOdz0dhIh6Q2QBYISnjdCj+mJ4PQ+/PNl3nbjq7LGYH19oNV3G8gTZQDHFYWEL6DB517caeKiMZFT6JOgwK5Dd/+JEOuBjUkyP3CuMH8VfB6vrTsmpV3SkaizujCB+LUnzMtFdGOJ3KEhR5OS9pq6nwAW1AYOMTAcT+s=
on_success: always