-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
120 lines (109 loc) · 3.59 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
sudo: false
dist: trusty
osx_image: xcode7.3
language: cpp
cache: ccache
services:
- docker
compiler:
- clang
- gcc
os:
- linux
- osx
env:
matrix:
- TRAVIS_CMAKE_GENERATOR="Unix Makefiles" TRAVIS_BUILD_TYPE="Release"
- TRAVIS_CMAKE_GENERATOR="Unix Makefiles" TRAVIS_BUILD_TYPE="Debug"
global:
- PROJECT_DIR_ABS=$TRAVIS_BUILD_DIR
- YARP_DOCKER_TAG="bin"
- DOCKER_IMAGE="robotology/yarp-tdd:gazebo8${YARP_DOCKER_TAG}"
matrix:
include:
- os: osx
env: TRAVIS_CMAKE_GENERATOR="Xcode" TRAVIS_BUILD_TYPE="Release"
- os: osx
env: TRAVIS_CMAKE_GENERATOR="Xcode" TRAVIS_BUILD_TYPE="Debug"
before_install:
# Install ccache and build dependencies on osx
- >-
if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
brew install ccache || travis_terminate 1
export PATH="/usr/local/opt/ccache/libexec:$PATH"
gem install xcpretty || travis_terminate 1
brew update &> /dev/null || travis_terminate 1
brew tap robotology/cask || travis_terminate 1
brew tap homebrew/science || travis_terminate 1
brew install eigen yarp || travis_terminate 1
brew install qt || travis_terminate 1
export PATH="/usr/local/opt/qt/bin/:$PATH"
elif [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker pull robotology/yarp-tdd:gazebo8${YARP_DOCKER_TAG} || travis_terminate 1
docker run -it \
--name baseimage \
$DOCKER_IMAGE \
sh -c 'export CMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/cmake/:${CMAKE_PREFIX_PATH}" &&\
apt-get update &&\
apt-get install -y qtbase5-dev libqt5xmlpatterns5-dev' \
|| travis_terminate 1
docker commit baseimage imagewithdeps || travis_terminate 1
fi
before_script:
# Run CMake into the persistent $PROJECT_DIR_ABS folder
- cd $PROJECT_DIR_ABS
- mkdir build && cd build
- >-
if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
cmake -G"${TRAVIS_CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} \
.. \
|| travis_terminate 1
elif [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker run -it --rm \
-v "$HOME/.ccache:/root/.ccache" \
-v "$PROJECT_DIR_ABS:/app" -w /app \
-e CC=$CC \
-e CXX=$CXX \
imagewithdeps \
sh -c 'cd build && cmake -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} ..' \
|| travis_terminate 1
fi
script:
# Build the project
- >-
if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
cmake --build . --config ${TRAVIS_BUILD_TYPE} \
|| travis_terminate 1
elif [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker run -it --rm \
-v "$HOME/.ccache:/root/.ccache" \
-v "$PROJECT_DIR_ABS:/app" -w /app \
-e CC=$CC \
-e CXX=$CXX \
imagewithdeps \
sh -c 'cd build && cmake --build . --config ${TRAVIS_BUILD_TYPE}' \
|| travis_terminate 1
fi
after_success:
# Install the project (just for logging)
- >-
if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
cmake --build . --config ${TRAVIS_BUILD_TYPE} --target install \
|| travis_terminate 1
elif [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker run -it --rm \
-v "$HOME/.ccache:/root/.ccache" \
-v "$PROJECT_DIR_ABS:/app" -w /app \
-e CC=$CC \
-e CXX=$CXX \
imagewithdeps \
sh -c 'cd build && cmake --build . --config ${TRAVIS_BUILD_TYPE} --target install' \
|| travis_terminate 1
fi
# Enable when tests are added to the repo
# - ctest --build . --config ${TRAVIS_BUILD_TYPE}
# Fill with mantainer(s) emails
# notifications:
# email:
# - whowantstobemantainedr@email.com