forked from cyberbotics/webots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
251 lines (251 loc) · 10.7 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
os: linux
dist: xenial
cache:
pip: true
services:
- xvfb
notifications:
email:
recipients:
on_success: change
on_failure: always
after_failure: >
if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then curl -H "Content-Type: application/json" -X POST -d "{\"content\": \"Webots need your Help! Nightly build failed during the '$(echo $TRAVIS_BUILD_STAGE_NAME)' stage on the '$(echo $TRAVIS_BRANCH)' branch: $(echo $TRAVIS_BUILD_WEB_URL)\" }" $DISCORD_WEBHOOK; fi
jobs:
include:
- &source_tests_staging
stage: Sources Tests
name: Ubuntu 16.04 / Python 3.8
git:
depth: 3
submodules: false
os: linux
dist: xenial
language: python
python: '3.8'
addons:
apt:
packages:
- clang-format-6.0
install:
- pip install -r tests/sources/requirements.txt
- pip install -r docs/tests/requirements.txt
- cp dependencies/.clang-format-6 .clang-format
script:
- python -m unittest discover -s docs/tests
- |
# in case of manually triggered test, planned test or tag test, run complete test
if [[ "$TRAVIS_COMMIT_MESSAGE" != travis_* ]] && [[ "$TRAVIS_EVENT_TYPE" != "api" ]] && [[ "$TRAVIS_EVENT_TYPE" != "cron" ]] && [[ -z "${TRAVIS_TAG}" ]]
then
tests/sources/generate_diff.py $TRAVIS_COMMIT $TRAVIS_REPO_SLUG;
fi
- travis_wait 30 python -m unittest discover -s tests/sources
- <<: *source_tests_staging
if: type = cron OR commit_message IN (travis_sources, travis_unit, travis_release, travis_distrib) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: Ubuntu 16.04 / Python 2.7
python: '2.7'
- <<: *source_tests_staging
if: type = cron OR commit_message IN (travis_sources, travis_unit, travis_release, travis_distrib) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: Ubuntu 18.04 / Python 3.8
dist: bionic
- <<: *source_tests_staging
if: type = cron OR commit_message IN (travis_sources, travis_unit, travis_release, travis_distrib) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: Ubuntu 18.04 / Python 2.7
python: '2.7'
dist: bionic
- <<: *source_tests_staging
if: type = cron OR commit_message IN (travis_sources, travis_unit, travis_release, travis_distrib) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: OSX / Python 2.7
os: osx
osx_image: xcode10.2 # Xcode: 10.2.1 | macOS: 10.14
language: generic # Travis doesn't support python on macos yet
addons:
homebrew:
packages:
- clang-format
- cppcheck
- python
install:
- pip install -r tests/sources/requirements.txt
- pip install -r docs/tests/requirements.txt
- cp dependencies/.clang-format-9 .clang-format
- &unit_tests_staging
stage: Unit Tests
if: type = cron OR commit_message IN (travis_unit, travis_release, travis_distrib, travis_unit_only) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: Ubuntu 16.04 / Python 3.8 / openjdk 8 / ROS kinetic
git: &compilation_git
depth: 3
submodules: true
os: linux
dist: xenial
install: skip # bundle install is not required
language: python
python: 3.8
jdk: openjdk8
addons: &apt_packages
apt:
packages:
- g++
- cmake
- libusb-dev
- swig
- python2.7-dev
- libglu1-mesa-dev
- libglib2.0-dev
- libfreeimage-dev
- libfreetype6-dev
- libxml2-dev
- libzzip-0-13
- libssl-dev
- libboost-dev
- libavcodec-extra
- libgd-dev
- libssh-gcrypt-dev
- libzip-dev
- python-pip
- libreadline-dev
- libassimp-dev
- libav-tools
- npm
- python3.5-dev
- openjdk-8-jdk
- curl
- libwebpdemux1
- fakeroot
- pbzip2
- libxkbcommon-x11-dev
before_install:
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt update
- sudo apt install -y python3.6-dev python3.7-dev python3.8-dev
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- export PATH=$JAVA_HOME/bin:$PATH
- export ROS_DISTRO=kinetic
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt update -qq
- sudo apt-get install -y ros-$ROS_DISTRO-ros-base ros-$ROS_DISTRO-sensor-msgs ros-$ROS_DISTRO-tf
- sudo rosdep init
- rosdep update
- pip install rospkg catkin_pkg empy defusedxml netifaces # by default ros only comes with python2.7 libraries
script:
- make release -j2
- make release -j2 -C tests
- python tests/test_suite.py --no-ansi-escape --nomake
- ./tests/ros.sh
- <<: *unit_tests_staging
name: Ubuntu 18.04 / Python 3.8 / openjdk 11 / ROS melodic
dist: bionic
jdk: openjdk11
before_install:
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt update
- sudo apt install -y python3.8-dev
- export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
- export PATH=$JAVA_HOME/bin:$PATH
- export ROS_DISTRO=melodic
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt update -qq
- sudo apt-get install -y ros-$ROS_DISTRO-ros-base ros-$ROS_DISTRO-sensor-msgs ros-$ROS_DISTRO-tf
- sudo rosdep init
- rosdep update
- pip install rospkg catkin_pkg empy defusedxml netifaces # by default ros only comes with python2.7 libraries
addons: &bionic_apt_packages
apt:
packages:
- g++
- cmake
- libusb-dev
- swig
- python2.7-dev
- libglu1-mesa-dev
- libglib2.0-dev
- libfreeimage-dev
- libfreetype6-dev
- libxml2-dev
- libzzip-0-13
- libssl1.0-dev
- libboost-dev
- libavcodec-extra
- libgd-dev
- libssh-gcrypt-dev
- libzip-dev
- python-pip
- libreadline-dev
- libassimp-dev
- ffmpeg
- npm
- python3.6-dev
- python3.7-dev
- openjdk-11-jdk
- curl
- fakeroot
- pbzip2
- libxkbcommon-x11-dev
- &distribution_staging
stage: Distribution
if: type = cron OR commit_message IN (travis_release, travis_release_only, travis_distrib, travis_distrib_only) OR (NOT tag =~ ^nightly_ AND tag IS present)
name: Ubuntu 16.04 / Python 3.8 / openjdk 8
git: *compilation_git
os: linux
dist: xenial
install: skip # bundle install is not required
language: python
python: 3.8
jdk: openjdk8
addons: *apt_packages
before_install:
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt update
- sudo apt install python3.6-dev python3.7-dev python3.8-dev
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- export PATH=$JAVA_HOME/bin:$PATH
- pip install PyGithub # used to upload packages to Github releases
script:
- if [[ -z "${TRAVIS_TAG}" ]]; then python src/packaging/set_commit_and_date_in_version.py $TRAVIS_COMMIT; fi
- make distrib -j2
- if [[ "$(ls -l distribution | grep -v ^l | wc -l)" -ne "4" ]]; then echo Wrong number of files in the distribution folder; exit -1; fi # make sure all the required files are generated
- if [ "$TRAVIS_COMMIT_MESSAGE" != travis_release* ]; then src/packaging/publish_release.py --key=$GITHUB_API_KEY --repo=$TRAVIS_REPO_SLUG --branch=$TRAVIS_BRANCH --commit=$TRAVIS_COMMIT --tag=$TRAVIS_TAG; fi
- <<: *distribution_staging
name: Ubuntu 18.04 / Python 3.8 / openjdk 11 (no release upload)
dist: bionic # on Ubuntu 18.04 we just test the package creation but do not upload it
jdk: openjdk11
before_install:
- sudo add-apt-repository ppa:deadsnakes/ppa -y
- sudo apt update
- sudo apt install -y python3.8-dev
- export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
- export PATH=$JAVA_HOME/bin:$PATH
addons: *bionic_apt_packages
script:
- make distrib -j2
- if [[ "$(ls -l distribution | grep -v ^l | wc -l)" -ne "3" ]]; then echo Wrong number of files in the distribution folder; exit -1; fi # make sure all the required files are generated
- <<: *distribution_staging
name: OSX / Python 2.7
os: osx
osx_image: xcode10.2 # Xcode: 10.2.1 | macOS: 10.14
language: generic # Travis doesn't support python on macos yet
addons:
homebrew:
packages:
- python
- cmake
- swig
- wget
- node
before_install:
- export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
- export PATH=/usr/local/bin/:$PATH # Prefer Brew binaries over Travis ones.
- npm install -g appdmg
- pip install PyGithub # used to upload packages to Github releases
- sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.7 # we can't use python3.7 from homebrew for the compilation because it is not compatible with the normal one
- if [[ ! -f $WEBOTS_HOME/dependencies/python3.7.zip ]]; then wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.7.zip -P $WEBOTS_HOME/dependencies; fi
- sudo unzip -o -q $WEBOTS_HOME/dependencies/python3.7.zip -d /Library/Frameworks/Python.framework/Versions/3.7
- export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.7/bin
script:
- if [[ -z "${TRAVIS_TAG}" ]]; then python src/packaging/set_commit_and_date_in_version.py $TRAVIS_COMMIT; fi
- make distrib -j2
- if [[ "$(ls -l distribution | grep -v ^l | wc -l)" -ne "3" ]]; then echo Wrong number of files in the distribution folder; exit -1; fi # make sure all the required file are generated
- if [ "$TRAVIS_COMMIT_MESSAGE" != travis_release* ]; then src/packaging/publish_release.py --key=$GITHUB_API_KEY --repo=$TRAVIS_REPO_SLUG --branch=$TRAVIS_BRANCH --commit=$TRAVIS_COMMIT --tag=$TRAVIS_TAG; fi