forked from robotology/human-dynamics-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
203 lines (186 loc) · 5.96 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
dist: trusty
language: cpp
cache:
directories:
- $HOME/.ccache
- $HOME/Library/Caches/Homebrew
services:
- docker
compiler:
- clang
- gcc
os: linux
stages:
- test # Default stage with job matrix
- osx
- deploy
env:
global:
- TRAVIS_CMAKE_GENERATOR="Ninja"
- DEPS_BRANCH="master"
matrix:
- TRAVIS_BUILD_TYPE="Release" UBUNTU="xenial"
- TRAVIS_BUILD_TYPE="Debug" UBUNTU="xenial"
- TRAVIS_BUILD_TYPE="Release" UBUNTU="bionic"
- TRAVIS_BUILD_TYPE="Debug" UBUNTU="bionic"
# ===================
# STAGE: test (linux)
# ===================
# This step is shared with osx stage
before_install: &before_install
- if [ "$TRAVIS_BRANCH" != "master" ] ; then export DEPS_BRANCH="devel" ; fi
- if echo $TRAVIS_COMMIT_MESSAGE | grep -F -q "[ci master]" ; then export DEPS_BRANCH="master" ; fi
- if echo $TRAVIS_COMMIT_MESSAGE | grep -F -q "[master ci]" ; then export DEPS_BRANCH="master" ; fi
install:
- echo "Using $DEPS_BRANCH for dependencies"
- >-
if [ "$UBUNTU" = "xenial" ] ; then
export DOCKER_IMAGE_NAME=robotology/robotology-tdd:gazebo8${DEPS_BRANCH}
elif [ "$UBUNTU" = "bionic" ] ; then
export DOCKER_IMAGE_NAME=robotology/robotology-tdd:gazebo9${DEPS_BRANCH}
else
travis_terminate 1
fi
- docker pull $DOCKER_IMAGE_NAME
# Start the test container
- export DEPS_INSTALL_PREFIX=/
- >-
docker run -it -d \
--name testContainer \
-v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR \
-v $HOME/.ccache:$HOME/.ccache \
-w $TRAVIS_BUILD_DIR \
--env-file .ci/env-file \
$DOCKER_IMAGE_NAME \
bash
# Install dependencies not included in the docker image
- docker exec testContainer ./.ci/build_deps.sh
script:
- docker exec testContainer ./.ci/script.sh
# ==========
# STAGE: osx
# ==========
stage_osx:
install: &osx_install
# Install ccache
- brew install ccache
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
# Setup the dependencies folder
- export DEPS_INSTALL_PREFIX=$HOME/deps
- export PATH=$PATH:$DEPS_INSTALL_PREFIX/bin
#- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPS_INSTALL_PREFIX/lib
- export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_INSTALL_PREFIX
# Fix https://github.com/travis-ci/travis-ci/issues/8826
- brew cask uninstall oclint
# Install dependencies
- brew install eigen ace tinyxml gsl dartsim/dart/ipopt qt
- export PATH="/usr/local/opt/qt/bin/:$PATH"
# Build other dependencies
- cd $TRAVIS_BUILD_DIR
- sh .ci/build_deps.sh || travis_terminate 1
script: &osx_script
- cd $TRAVIS_BUILD_DIR
- sh .ci/script.sh
# =============
# STAGE: deploy
# =============
stage_deploy:
script: &deploy_script
# Clone the gh-pages branch
- GH_PAGES_ROOTDIR=$HOME/gh-pages
- export GH_REPO_ORG=${TRAVIS_REPO_SLUG%*/*}
- export GH_REPO_NAME=${TRAVIS_REPO_SLUG#*/*}
- export GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git"
## Select the deploy folder
- DEPLOY_FOLDER=$GH_PAGES_ROOTDIR
#- if [ "$TRAVIS_BRANCH" = "master" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR ; fi
#- if [ "$TRAVIS_BRANCH" = "devel" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR/devel ; fi
# Check if the gh-pages branch exists and clone it
- cd $TRAVIS_BUILD_DIR
- git ls-remote --heads --exit-code https://$GH_REPO_REF gh-pages || travis_terminate 1
- git clone -b gh-pages https://$GH_REPO_REF $GH_PAGES_ROOTDIR
# Push only the current branch
- cd $GH_PAGES_ROOTDIR
- git config push.default simple
# Clean old documentation files
- rm -rf ${DEPLOY_FOLDER}/html
# Disable GitHub jekyll generation
- touch $GH_PAGES_ROOTDIR/.nojekyll
# Generate documentation
- cd $TRAVIS_BUILD_DIR
- mkdir build && cd build
- cmake .. -DBUILD_DOCS:BOOL=TRUE -DDOXYGEN_INSTALL_DIR=${DEPLOY_FOLDER}
- make dox || travis_terminate 1
- make install
# Deploy the folder
- cd $GH_PAGES_ROOTDIR
- git remote add origin-botlogin https://$GIT_COMMITTER_USERNAME:$DEPLOY_TOKEN@$GH_REPO_REF
- git add --all
- COMMIT_AUTHOR="$(git --no-pager show -s --format='%an <%ae>' $TRAVIS_COMMIT)"
- >-
git commit -m "Automatic docs deployment Travis#${TRAVIS_BUILD_NUMBER}" \
-m "Commit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT" \
--author "$COMMIT_AUTHOR"
- git push --force origin-botlogin gh-pages
# ======================
# BUILD JOBS FROM STAGES
# ======================
jobs:
include:
# ---------
# STAGE OSX
# ---------
- &osx_template
stage: osx
os: osx
osx_image: xcode9.3
before_install: *before_install
install: *osx_install
before_script: skip
script: *osx_script
after_failure: skip
after_success: skip
after_script: skip
env:
TRAVIS_CMAKE_GENERATOR="Xcode"
TRAVIS_BUILD_TYPE="Debug"
- <<: *osx_template
compiler: clang
env:
TRAVIS_CMAKE_GENERATOR="Unix Makefiles"
TRAVIS_BUILD_TYPE="Debug"
# ------------
# STAGE DEPLOY
# ------------
- &deploy_template
stage: deploy
compiler:
cache:
if: fork = false AND branch = "master" AND type != pull_request
before_install: skip
install: skip
install: skip
before_script: skip
script: *deploy_script
after_failure: skip
after_success: skip
after_script: skip
env:
GIT_COMMITTER_USERNAME=LOC2Bot
GIT_COMMITTER_NAME=LOC2Bot
DOXYGEN_INPUT_FOLDER=$TRAVIS_BUILD_DIR/build/doc/doxygen
MKDOCS_INPUT_FOLDER=$TRAVIS_BUILD_DIR/build/doc/mkdocs
addons:
apt:
packages:
- doxygen
- doxygen-doc
- doxygen-gui
- graphviz
- python3-pip
#- <<: *deploy_template
#if: fork = false AND branch = "devel" AND type != pull_request
# notifications:
# email: