forked from robotology/wb-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
218 lines (201 loc) · 6.3 KB
/
.travis.yml
File metadata and controls
218 lines (201 loc) · 6.3 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
dist: xenial
language: cpp
services: docker
os: linux
cache:
directories:
- $HOME/.ccache
- $HOME/Library/Caches/Homebrew
addons:
apt:
packages:
- docker-ce
homebrew:
update: true
packages:
- ccache
- eigen
- ace
- tinyxml
- gsl
stages:
- test # Default stage with job matrix
- osx
- name: deploy
if: fork = false AND branch IN (master, devel) AND type != pull_request AND env(DEPLOY_TOKEN) IS present
compiler:
- gcc
- clang
env:
global:
- TRAVIS_CMAKE_GENERATOR="Ninja"
- DEPS_BRANCH="master"
matrix:
- TRAVIS_BUILD_TYPE="Release" UBUNTU="bionic"
- TRAVIS_BUILD_TYPE="Debug" UBUNTU="bionic"
# ===================
# STAGE: test (linux)
# ===================
# This step is shared with osx stage
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
before_script:
- echo "Using $DEPS_BRANCH for dependencies"
- export DOCKER_IMAGE_NAME=robotology/robotology-tdd:gazebo9${DEPS_BRANCH}
- docker pull $DOCKER_IMAGE_NAME
# Start the container in the background
- >-
docker run -it -d \
--name ci \
-v "$TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR" \
-v "$HOME/.ccache:$HOME/.ccache" \
-w "$TRAVIS_BUILD_DIR" \
--env-file "$TRAVIS_BUILD_DIR/.ci/env-file" \
$DOCKER_IMAGE_NAME \
bash
# Fix the image waiting that current WBT master is used in the superbuild
- >-
docker exec -it \
-w /projects/robotology-superbuild/build/robotology/BlockFactory \
ci \
make install
script:
- docker exec ci ./.ci/script.sh
# ==========
# STAGE: osx
# ==========
stage_osx:
before_install: &osx_before_install
# Setup ccache
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
install: &osx_install
# Setup the dependencies folder
- export DEPS_CACHE=$HOME/deps
- export PATH=$PATH:$DEPS_CACHE/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPS_CACHE/lib
- export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
# Install dependencies
- cd $TRAVIS_BUILD_DIR/.ci
- ./install.sh || travis_terminate 1
script: &osx_script
- cd $TRAVIS_BUILD_DIR/.ci
- ./script.sh
# =============
# STAGE: deploy
# =============
stage_deploy:
install: &deploy_install
- pip3 install --user Pygments mkdocs mkdocs-material
- export PATH=$HOME/.local/bin:$PATH
script: &deploy_script
# Setup the dependencies cache
- export DEPS_CACHE=$HOME/cache/$TRAVIS_OS_NAME/$TRAVIS_BUILD_TYPE
- export PATH=$PATH:$DEPS_CACHE/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPS_CACHE/lib
- export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
# 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"
# 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
# Select the deploy folder
- if [ "$TRAVIS_BRANCH" = "master" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR ; fi
- if [ "$TRAVIS_BRANCH" = "devel" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR/devel ; fi
# Create the deploy folder if it does not exist
- mkdir -p $DEPLOY_FOLDER
# Push only the current branch
- cd $GH_PAGES_ROOTDIR
- git config push.default simple
# Disable GitHub jekyll generation
- touch $GH_PAGES_ROOTDIR/.nojekyll
# Generate documentation
- cd $TRAVIS_BUILD_DIR
- mkdir build
- cd build
- cmake .. -DWBT_BUILD_DOCS:BOOL=TRUE
- make dox || travis_terminate 1
- make mkdocs || travis_terminate 1
# Move the new doxygen documentation to the deploy folder
- rm -rf $DEPLOY_FOLDER/doxygen
- mv $DOXYGEN_INPUT_FOLDER/html $DEPLOY_FOLDER/doxygen
# Move the new mkdocs documentation to the deploy folder
- rm -rf $DEPLOY_FOLDER/mkdocs
- mv $MKDOCS_INPUT_FOLDER $DEPLOY_FOLDER/mkdocs
# 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: xcode10.1
services:
before_install: *osx_before_install
install: *osx_install
before_script: skip
script: *osx_script
after_failure: skip
after_success: skip
after_script: skip
compiler:
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:
before_install: skip
install: *deploy_install
before_script: skip
script: *deploy_script
after_failure: skip
after_success: skip
after_script: skip
env:
GIT_COMMITTER_USERNAME=LOC2Bot
GIT_COMMITTER_NAME=LOC2Bot
GIT_COMMITTER_EMAIL=locomotion.control@gmail.com
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
- python3-setuptools
- python3-wheel
# notifications:
# email:
# - whowantstobemantainedr@email.com