Skip to content

Commit bfc232e

Browse files
committed
ci: Include Debug build in Travis CI build, refactor build matrix
1 parent b574fd8 commit bfc232e

File tree

3 files changed

+27
-34
lines changed

3 files changed

+27
-34
lines changed

.travis.yml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@ sudo: required
33

44
language: cpp
55

6-
compiler:
7-
- g++
8-
- clang
9-
106
git:
117
depth: 10
128

13-
os:
14-
- linux
15-
- osx
16-
179
env:
1810
global:
1911
# versions of VTK for each OS
@@ -27,39 +19,40 @@ env:
2719
- WITH_TBB=${WITH_TBB:-ON} # build with TBB is always recommended
2820
- WITH_FLANN=${WITH_FLANN:-ON} # build with FLANN is optional, but requires only little extra build time
2921
- WITH_FLTK=${WITH_FLTK:-ON} # build with FLTK-based Viewer when WITH_VTK is turned ON
22+
- WITH_VTK=${WITH_VTK:-ON} # by default, build with VTK
3023
- WITH_ITK=${WITH_ITK:-OFF} # required by ANTs N4 which is included in DrawEM package
31-
# exclude DrawEM from Travis CI build for now, see https://github.com/MIRTK/DrawEM/pull/27
24+
# exclude DrawEM from Travis CI build for now, see https://github.com/MIRTK/DrawEM/pull/27
25+
- BUILD_TYPE=Release # default build configuration
3226
# build and deployment of AppImage for Linux
3327
- AppImage_BUILD=${AppImage_BUILD:-ON}
3428
- AppImage_BRANCH=${AppImage_BRANCH:-master}
3529
- AppImage_DEVEL=${AppImage_DEVEL:-ON}
3630
- AppImage_LATEST=${AppImage_LATEST:-ON}
3731
- AppImage_RELEASE=${AppImage_RELEASE}
38-
matrix:
39-
- WITH_VTK=OFF # make sure that MIRTK can be build fine without VTK
40-
- WITH_VTK=ON # test build with all moduldes, including those using VTK
4132

42-
matrix:
33+
jobs:
34+
include:
35+
# build optimized code with all modules for AppImage generation
36+
- os: linux
37+
compiler: g++
38+
env: BUILD_TYPE=Release WITH_VTK=ON
39+
# ensure assertions and debug code compiles
40+
- os: linux
41+
compiler: g++
42+
env: BUILD_TYPE=Debug WITH_VTK=ON
43+
# make sure that MIRTK can be build fine without VTK
44+
- os: linux
45+
compiler: g++
46+
env: BUILD_TYPE=Release WITH_VTK=OFF
47+
# build on macOS using clang and recent VTK version
48+
- os: osx
49+
compiler: clang
50+
env: BUILD_TYPE=Release WITH_VTK=ON
51+
# the osx build often breaks with homebrew changes, so we allow it to fail on master
4352
allow_failures:
44-
# the osx build often breaks with homebrew changes, so we allow it to fail
4553
- os: osx
46-
exclude:
47-
# in order to reduce number of jobs to wait for, test only main compilers
48-
# used on each OS
49-
- os: linux
50-
compiler: clang
51-
- os: osx
52-
compiler: g++
53-
# travis-ci.org has low capacity for macOS jobs, thus reduce number of
54-
# macOS jobs to only the essential ones. With the following, we only need
55-
# to wait for one macOS job.
56-
# Because on macOS usually a very recent VTK version is installed with
57-
# Homebrew, it is more interesting to build with VTK on macOS than on
58-
# Ubuntu. When the GCC build without VTK on Ubuntu succeeds, chances
59-
# are very high it also builts fine on macOS.
60-
- os: osx
61-
compiler: clang
62-
env: WITH_VTK=OFF
54+
if: branch = master
55+
fast_finish: true
6356

6457
cache:
6558
ccache: true
@@ -78,7 +71,7 @@ script:
7871
- Scripts/travis.sh
7972

8073
after_success:
81-
- 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
74+
- 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
8275
export AppImage_BINTRAY=ON;
8376
else
8477
export AppImage_BINTRAY=OFF;

Scripts/install_depends.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ if [ $WITH_VTK = ON ] && [ -n "$VTK_VERSION" ]; then
220220
# build configuration
221221
cmake_args=(
222222
-DCMAKE_INSTALL_PREFIX="$vtk_prefix"
223-
-DCMAKE_BUILD_TYPE=Release
223+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Release}
224224
)
225225
# pre-requisites to use system installations
226226
if [ $os = osx ] || [ $os = Darwin ]; then

Scripts/travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fi
8282
mkdir Build && cd Build
8383
run "$cmake_cmd" \
8484
-D CMAKE_INSTALL_PREFIX=/usr \
85-
-D CMAKE_BUILD_TYPE=Release \
85+
-D CMAKE_BUILD_TYPE=${BUILD_TYPE:-Release} \
8686
-D BUILD_SHARED_LIBS=ON \
8787
-D BUILD_APPLICATIONS=ON \
8888
-D BUILD_TESTING=$TESTING \

0 commit comments

Comments
 (0)