Skip to content

Commit

Permalink
ci: Include Debug build in Travis CI build, refactor build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
schuhschuh committed Sep 21, 2020
1 parent b574fd8 commit 0e5b44c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
49 changes: 25 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Scripts/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 0e5b44c

Please sign in to comment.