-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path.travis.yml
143 lines (127 loc) · 3.16 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
dist: xenial
language: cpp
services: docker
os: linux
addons:
homebrew:
update: true
taps: osrf/simulation
packages:
- ccache
- swig
- ninja
- qt5
- gflags
- ignition-cmake2
- ignition-plugin1
- ignition-math6
- ignition-common3
- ignition-transport7
- ignition-msgs4
- ignition-tools
- ignition-fuel-tools3
- sdformat8
- ignition-physics1
- ignition-rendering2
- ignition-sensors2
- ignition-gui2
cache:
directories:
- $HOME/.ccache
- $HOME/Library/Caches/Homebrew
stages:
- test # Default stage with job matrix
- osx
compiler:
- gcc
#- clang # TODO: pytest fails with clang
env:
global:
- UBUNTU="bionic"
- TRAVIS_CMAKE_GENERATOR="Ninja"
- TRAVIS_INSTALL_PREFIX="/usr/local"
matrix:
- TRAVIS_BUILD_TYPE="Release"
- TRAVIS_BUILD_TYPE="Debug"
# ===================
# STAGE: test (linux)
# ===================
install:
- >-
if [ "$TRAVIS_EVENT_TYPE" = "cron" ] ; then
# Build the docker image
cd $TRAVIS_BUILD_DIR/.ci
docker build --pull --build-arg from=ubuntu:$UBUNTU --build-arg install_prefix="$TRAVIS_INSTALL_PREFIX" --rm -t diegoferigo/gym-ignition .
docker login --username=$DOCKERHUB_USERNAME --password=$DOCKERHUB_PASSWORD
docker push diegoferigo/gym-ignition
else
# Download the image
docker pull diegoferigo/gym-ignition
fi
script:
# Execute the script
- >-
docker run -it --rm \
-v $TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR \
-v $HOME/.ccache:$HOME/.ccache \
-w $TRAVIS_BUILD_DIR \
--env-file $TRAVIS_BUILD_DIR/.ci/env.list \
diegoferigo/gym-ignition \
sh .ci/script.sh
# ==========
# STAGE: osx
# ==========
stage_osx:
before_install: &osx_before_install
# Setup ccache
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
# Setup qt
- export Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5
install: &osx_install
# Install ign-gazebo
- cd $HOME
- git clone --depth 1 https://github.com/diegoferigo/ign-gazebo
- cd ign-gazebo && mkdir -p build && cd build
- >-
cmake \
-G"Ninja" \
-DCMAKE_BUILD_TYPE="$TRAVIS_BUILD_TYPE" \
-DBUILD_TESTING:BOOL=OFF \
..
- cmake --build . --target install
# Install pytest
- pip3 install pytest
before_script: &osx_before_script
- export TRAVIS_INSTALL_PREFIX="$HOME/local"
script: &osx_script
- cd $TRAVIS_BUILD_DIR/.ci
- ./script.sh
# ======================
# BUILD JOBS FROM STAGES
# ======================
jobs:
allow_failures:
- os: osx
include:
# ---------
# STAGE OSX
# ---------
- &osx_template
stage: osx
os: osx
osx_image: xcode10.2
services:
before_install: *osx_before_install
install: *osx_install
before_script: *osx_before_script
script: *osx_script
after_script: skip
after_failure: skip
after_success: skip
env:
TRAVIS_CMAKE_GENERATOR="Xcode"
TRAVIS_BUILD_TYPE="Release"
- <<: *osx_template
env:
TRAVIS_CMAKE_GENERATOR="Ninja"
TRAVIS_BUILD_TYPE="Release"