From 0e5b44cd9c4c0e72d8a81ec291a9d9bdac02d6bd Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Mon, 21 Sep 2020 15:56:53 +0100 Subject: [PATCH] ci: Include Debug build in Travis CI build, refactor build matrix --- .travis.yml | 49 +++++++++++++++++++------------------- Scripts/install_depends.sh | 2 +- Scripts/travis.sh | 2 +- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc8ec53bc..3fbddcae4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,39 +27,40 @@ env: - WITH_TBB=${WITH_TBB:-ON} # build with TBB is always recommended - WITH_FLANN=${WITH_FLANN:-ON} # build with FLANN is optional, but requires only little extra build time - WITH_FLTK=${WITH_FLTK:-ON} # build with FLTK-based Viewer when WITH_VTK is turned ON + - WITH_VTK=${WITH_VTK:-ON} # by default, build with VTK - WITH_ITK=${WITH_ITK:-OFF} # required by ANTs N4 which is included in DrawEM package - # exclude DrawEM from Travis CI build for now, see https://github.com/MIRTK/DrawEM/pull/27 + # exclude DrawEM from Travis CI build for now, see https://github.com/MIRTK/DrawEM/pull/27 + - BUILD_TYPE=Release # default build configuration # build and deployment of AppImage for Linux - AppImage_BUILD=${AppImage_BUILD:-ON} - AppImage_BRANCH=${AppImage_BRANCH:-master} - AppImage_DEVEL=${AppImage_DEVEL:-ON} - AppImage_LATEST=${AppImage_LATEST:-ON} - AppImage_RELEASE=${AppImage_RELEASE} - matrix: - - WITH_VTK=OFF # make sure that MIRTK can be build fine without VTK - - WITH_VTK=ON # test build with all moduldes, including those using VTK -matrix: +jobs: + include: + # build optimized code with all modules for AppImage generation + - os: linux + compiler: g++ + env: BUILD_TYPE=Release WITH_VTK=ON + # ensure assertions and debug code compiles + - os: linux + compiler: g++ + env: BUILD_TYPE=Debug WITH_VTK=ON + # make sure that MIRTK can be build fine without VTK + - os: linux + compiler: g++ + env: BUILD_TYPE=Release WITH_VTK=OFF + # build on macOS using clang and recent VTK version + - os: osx + compiler: clang + env: BUILD_TYPE=Release WITH_VTK=ON + # the osx build often breaks with homebrew changes, so we allow it to fail on master allow_failures: - # the osx build often breaks with homebrew changes, so we allow it to fail - os: osx - exclude: - # in order to reduce number of jobs to wait for, test only main compilers - # used on each OS - - os: linux - compiler: clang - - os: osx - compiler: g++ - # travis-ci.org has low capacity for macOS jobs, thus reduce number of - # macOS jobs to only the essential ones. With the following, we only need - # to wait for one macOS job. - # Because on macOS usually a very recent VTK version is installed with - # Homebrew, it is more interesting to build with VTK on macOS than on - # Ubuntu. When the GCC build without VTK on Ubuntu succeeds, chances - # are very high it also builts fine on macOS. - - os: osx - compiler: clang - env: WITH_VTK=OFF + if: branch = master + fast_finish: true cache: ccache: true @@ -78,7 +79,7 @@ script: - Scripts/travis.sh after_success: - - if [ "$AppImage_BUILD" = ON ] && [ "$TRAVIS_REPO_SLUG" = "BioMedIA/MIRTK" ] && [ "$TRAVIS_BRANCH" = "$AppImage_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ] && [ "$TRAVIS_OS_NAME" = linux ] && [ "$WITH_VTK" = ON ]; then + - if [ "$AppImage_BUILD" = ON ] && [ "$TRAVIS_REPO_SLUG" = "BioMedIA/MIRTK" ] && [ "$TRAVIS_BRANCH" = "$AppImage_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" = false ] && [ "$TRAVIS_OS_NAME" = linux ] && [ "$WITH_VTK" = ON ] && [ "$BUILD_TYPE" = Release ]; then export AppImage_BINTRAY=ON; else export AppImage_BINTRAY=OFF; diff --git a/Scripts/install_depends.sh b/Scripts/install_depends.sh index 181ee7afc..a1b0d793e 100755 --- a/Scripts/install_depends.sh +++ b/Scripts/install_depends.sh @@ -220,7 +220,7 @@ if [ $WITH_VTK = ON ] && [ -n "$VTK_VERSION" ]; then # build configuration cmake_args=( -DCMAKE_INSTALL_PREFIX="$vtk_prefix" - -DCMAKE_BUILD_TYPE=Release + -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} ) # pre-requisites to use system installations if [ $os = osx ] || [ $os = Darwin ]; then diff --git a/Scripts/travis.sh b/Scripts/travis.sh index d2b747b21..840609cf1 100755 --- a/Scripts/travis.sh +++ b/Scripts/travis.sh @@ -82,7 +82,7 @@ fi mkdir Build && cd Build run "$cmake_cmd" \ -D CMAKE_INSTALL_PREFIX=/usr \ - -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \ -D BUILD_SHARED_LIBS=ON \ -D BUILD_APPLICATIONS=ON \ -D BUILD_TESTING=$TESTING \