Revision 084b5b02ed32f0b120fa32723bf732b185d52161 authored by Konrad Werys on 09 November 2018, 14:12:56 UTC, committed by Konrad Werys on 09 November 2018, 14:12:56 UTC
1 parent c6d23f5
.travis.yml
#------------------------------------#
# Tomato #
#------------------------------------#
language: cpp
os:
- linux
- osx
compiler:
- gcc
# - clang
branches:
# Blacklist the documentation branch
except:
- gh-pages
# Environment variables
env:
# VXL c++11 needs cmake 3.9.5, which is not installed on travis. TODO: fix it
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
- USE_ITK: "OFF"
- EXTENDED_BUILD: "OFF"
- DEPLOY_BUILD: "OFF"
- secure: 4wedfy5OEFLLO3/29WFF8fFE8jOqXDIb8Kc4VOBw2Yrr599NFDpDBgy9dzGtDzvvpkt/hbSh5lSSPB8KzN6+zX8JTJg2LNPmVEfpZILiTOpOKnydLHWWuznMSrtEic1DDGTp30sJXk3JWBKpmAsDMAssM35lwLNIR9BjpKOadACt5FTOvwXneCnbVr8iJ4F38EIInKQYwVhntBiCvcl+YrrLW6zSbJruEBGX1SpRRgQp8DcT9z4fOob0bIl27VFQcenHx694uzv/qIkU7pgfqV9CB3OTNjwsrgM/tY6O903PtXUpE/LA9ZCDj8NdTdOJa5OBBgsUGKu3vcc9qL5oLUKGqpMHInPpIBLDzuGaypMC2Fl675DAxe11EVGgX4ZtQAphdUw0PnFGCr5f8PafaFuKXKq0TpAn9ZO8QH3L5OrRbpLG2QDHcjYnhzyoaCNtNcQS0syPO51auzFdDRKNsq7Yvjph0uYLSlrgK2ZH2HJWeYgmgVKn79KYRmNEHTnHj+RHSnLP4b20SmQM2gOQ6v/+WMlShjgn5uul9k3s76baBrGsNgyHH95/2KG8NiSHVhwQzerY+tCn5aoRrVu+BbNT2IzdHoncf7JvE6CliQpMH/tW4EBrg0ceyvzemzVd7blbIWRRWkYrE6sqFvMOzSx6R8Jd059rEFu6JtEGGgQ=
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- 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
install:
# install coverage tools only in linux g++
- if [ "$EXTENDED_BUILD" == "ON" ]; then
sudo pip install codecov;
fi
- cd ${TRAVIS_BUILD_DIR}
# download ITK
- cd ..;
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
curl -L -O https://www.dropbox.com/s/zi7wfc9qev2529d/ITK413_osx_install.zip;
unzip -a -q ITK413_osx_install.zip;
export USE_ITK="ON";
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
curl -L -O https://www.dropbox.com/s/w35r9k376gg1cc3/ITK413_linux_install.zip;
unzip -a -q ITK413_linux_install.zip;
export USE_ITK="ON";
fi
- cd ${TRAVIS_BUILD_DIR};
script:
# configure and generate
- cmake . -DCMAKE_INSTALL_PREFIX=install -DUSE_NR2=OFF -DUSE_NR3=OFF -DUSE_PRIVATE_NR2=OFF -DCMAKE_CXX_STANDARD=${CXX_STANDARD} -DUSE_ITK=${USE_ITK}
# add coverage option (only in linux g++)
- if [ "$EXTENDED_BUILD" == "ON" ]; then
cmake -DCOVERAGE=1 . ;
fi
# this is make
- make -j8
- make install
# testing and getting the test coverage
- cd install/tests
- ./TomatoTests
- cd $TRAVIS_BUILD_DIR
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 ;
eval "lcov --no-external --directory . --capture --output-file coverage.info" ;
eval "lcov --remove coverage.info 'thirdParty/*' 'tests/*' -o coverage.info" ;
eval "lcov --list coverage.info" ;
bash <(curl -s https://codecov.io/bash) || 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 ;
chmod +x generateDocumentationAndDeploy.sh;
./generateDocumentationAndDeploy.sh;
fi
before_deploy:
- echo "Ready to deploy?"
- mkdir deployment
# copy the data
- cd install/tests/testData
- zip -r testData.zip dicom
- zip -r testData.zip Hcmr_Phantom_1916_Shmolli_192i_e11_fileList.yaml
- cp testData.zip ${TRAVIS_BUILD_DIR}/deployment/testData.zip
- cd $TRAVIS_BUILD_DIR
# copy the executable
- export exe_extended_name=TomatoExe_${TRAVIS_BRANCH}_${TRAVIS_OS_NAME} # just a variable
- cp TomatoExe ${exe_extended_name}
- cd deployment
# Problem: when deploying an executable as it is, somewhere in the process its permission to execute (-x) is lost.
# Solution: zip it and deploy the archive
- zip -r ${exe_extended_name}.zip ../${exe_extended_name}
- cd ..
deploy:
provider: releases # GitHub
api_key:
secure: G/JizU88P0TprUP5Xuyi00RHTHz9XbKDiB7D4jVfpFBr0OH+G/ofBlbgmbzYc5u4bnJD+yMQHIGpeeKqnykWg0s1ZwWy2BqCRk0AEBXwHGS8IEzcH025moEep9XOufLIzu8LB25+goWoiWNzJKdwZ4k7vgCRwbCcI186hEcoonkwUGkIILCgrO9XGI09aEmchCs1WAK3hu17oJCo2QYF9kmYzBp8j/hwR0GlcmynOiZHWpHJNywSxzPlPaAJQf1OrOn5VvQq62+rdSjpPRDn9CZuwyp3sOggqiw33sXFXBvYT2B4a7ULyqXo3poSJpfB12cWMNOZt2OrFQb0LAJ1VXY6pS8Z7XZ4/kCyVm1zJ0z60MnY+P9RTmN4cwQY6Jul1H/Rw4rRi7F1GzDFBV54reTN14BQqBdCaW7ZbW4a33niQGpNeNk57/tZLEBrOyR2r3NlZm0CEK/c4oer4Q+aQPcd5d8B0SpvDIrhFzlbBEsT5snJbrA6WNMrS2Xp5NMm/P80CvLoNBMGbNBXQwpav0K7KKAqgXnH7zZQm8k4ZWsk888laOag3kDMiYXJ7MMrmWZBQ7HN43Cq4ZdUAaNKUvNMQblEchTR58EZ0Td9poFRt2bT9cigXWpgv+0NnUtU6MTthDkRliWKXAaTWlY5HQTHjuuKBUkGTr1O61znnhY=
file_glob: ON # to use wildcards
file: deployment/*
skip_cleanup: ON
on:
tags: ON
condition: ${DEPLOY_BUILD} == "ON" # I guess I have to pick one compiler
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...