forked from robotology/human-dynamics-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
153 lines (141 loc) · 4.53 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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
- DOCKER_IMAGE=robotology/yarp-tdd:gazebo8master
matrix:
include:
- os: osx
env: TRAVIS_CMAKE_GENERATOR="Xcode", TRAVIS_BUILD_TYPE="Release"
- os: osx
env: TRAVIS_CMAKE_GENERATOR="Xcode", TRAVIS_BUILD_TYPE="Debug"
# Enable a job for building the documentation
- os: linux
env: TRAVIS_CMAKE_GENERATOR="Unix Makefiles", TRAVIS_BUILD_TYPE="Release" TRAVIS_BUILD_DOCS=true
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-gui
- graphviz
before_install:
# Pull the docker image if this is a linux build and install the binary
# dependencies in the docker image or osx
- >-
if [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker pull $DOCKER_IMAGE || travis_terminate 1
docker run -it \
-v "$PROJECT_DIR_ABS:/app" \
-w /app \
-e TRAVIS_OS_NAME \
--name baseimage \
$DOCKER_IMAGE \
sh .ci/install_deps.sh \
|| travis_terminate 1
docker commit baseimage imagewithbindeps || travis_terminate 1
elif [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
source $PROJECT_DIR_ABS/.ci/install_deps.sh
fi
before_script:
# Build the dependencies from sources
- >-
if [[ "$TRAVIS_OS_NAME" = "linux" ]] ; then
docker run -it \
-v "$PROJECT_DIR_ABS:/app" \
-v "$HOME/.ccache:/root/.ccache" \
-w /app \
-e CC=$CC \
-e CXX=$CXX \
-e TRAVIS_OS_NAME \
-e TRAVIS_BUILD_TYPE \
-e TRAVIS_CMAKE_GENERATOR \
--name imagewithbindeps \
imagewithbindeps \
sh .ci/build_deps.sh \
|| travis_terminate 1
docker commit imagewithbindeps imagewithalldeps || travis_terminate 1
elif [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
source $PROJECT_DIR_ABS/.ci/build_deps.sh
fi
# Run CMake into the persistent $PROJECT_DIR_ABS folder
- cd $PROJECT_DIR_ABS
- mkdir build && cd build
- >-
if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then
export CFLAGS="-Wno-old-style-cast -Wno-documentation-unknown-command -Wno-documentation -Wno-deprecated"
export CXXFLAGS=$CFLAGS
cmake -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 \
imagewithalldeps \
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 \
imagewithalldeps \
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 \
imagewithalldeps \
sh -c 'cd build && cmake --build . --config ${TRAVIS_BUILD_TYPE} --target install' \
|| travis_terminate 1
fi
# Generate the docs only if master, the travis_build_docs is true and we can use secure variables
- >-
if [[ "$TRAVIS_BRANCH" = "master" && -n "$TRAVIS_BUILD_DOCS" && "$TRAVIS_PULL_REQUEST" = "false" ]] ; then
cd $PROJECT_DIR_ABS
source .ci/setup-ssh.sh || travis_terminate 1
.ci/generateDocumentation.sh || 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: