forked from gsilano/BebopS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
117 lines (108 loc) · 4.84 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
# Generic .travis.yml file for running continuous integration on Travis-CI for
# any ROS package.
#
# Available here:
# - http://felixduvallet.github.io/ros-travis-integration
# - https://github.com/felixduvallet/ros-travis-integration
# - https://github.com/gsilano/ros-travis-integration
#
# This installs ROS on a clean Travis-CI virtual machine, creates a ROS
# workspace, resolves all listed dependencies, and sets environment variables
# (setup.bash). Then, it compiles the entire ROS workspace (ensuring there are
# no compilation errors), and runs all the tests. If any of the compilation/test
# phases fail, the build is marked as a failure.
#
# We handle two types of package dependencies specified in the package manifest:
# - system dependencies that can be installed using `rosdep`, including other
# ROS packages and system libraries. These dependencies must be known to
# `rosdistro` and get installed using apt-get.
# - package dependencies that must be checked out from source. These are handled by
# `wstool`, and should be listed in a file named dependencies.rosinstall.
#
# There are two variables you may want to change:
# - ROS_DISTRO (default is indigo, but also kinetic is now compatible). Note that
# packages must be available for ubuntu 14.04 trusty and xenial 16.04, respectively.
#
# See the README.md for more information.
#
# Author: Felix Duvallet <felixd@gmail.com>
# Author: Giuseppe Silano <g.silano89@gmail.com>
# NOTE: The build lifecycle on Travis.ci is something like this:
# before_install
# install
# before_script
# script
# after_success or after_failure
# after_script
# OPTIONAL before_deploy
# OPTIONAL deploy
# OPTIONAL after_deploy
################################################################################
# Use ubuntu xenial (16.04) and bionic (18.04) with sudo privileges.
matrix:
include:
- os: linux
dist: xenial
sudo: required
env: ROS_DISTRO=kinetic
- os: linux
dist: bionic
sudo: required
env: ROS_DISTRO=melodic
language:
- generic
cache:
- apt
# Configuration variables. All variables are global now, but this can be used to
# trigger a build matrix for different ROS distributions if desired.
env:
global:
- ROS_CI_DESKTOP="`lsb_release -cs`" # e.g. [precise|trusty|...]
- CI_SOURCE_PATH=$(pwd)
- ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall
- CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options
- ROS_PARALLEL_JOBS='-j8 -l6'
# Set the python path manually to include /usr/-/python2.7/dist-packages
# as this is where apt-get installs python packages.
- PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages
################################################################################
# Install system dependencies, namely a very barebones ROS setup.
before_install:
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- if [[ "$ROS_DISTRO" == "kinetic" ]]; then sudo rm /var/lib/dpkg/lock; fi
- if [[ "$ROS_DISTRO" == "kinetic" ]]; then sudo dpkg --configure -a; fi
- sudo apt-get update
- sudo apt-get install ros-$ROS_DISTRO-desktop-full ros-$ROS_DISTRO-joy ros-$ROS_DISTRO-octomap-ros ros-$ROS_DISTRO-mavlink
- sudo apt-get install python-wstool python-catkin-tools python-rosinstall build-essential
- sudo apt-get install protobuf-compiler libgoogle-glog-dev python-rosinstall-generator
- if [[ "$ROS_DISTRO" == "melodic" ]]; then sudo apt-get install python-rosdep; fi
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
- source /opt/ros/$ROS_DISTRO/setup.bash
# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin_init_workspace
- wstool init
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- git clone https://github.com/gsilano/BebopS.git
- git clone https://github.com/gsilano/rotors_simulator.git
- git clone https://github.com/gsilano/mav_comm.git
- git clone https://github.com/gsilano/bebop_autonomy.git
- cd ~/catkin_ws/src/rotors_simulator
- if [[ "$ROS_DISTRO" == "kinetic" ]]; then git checkout med18; fi
- if [[ "$ROS_DISTRO" == "melodic" ]]; then git checkout med18_gazebo9; fi
- cd ~/catkin_ws/src/mav_comm
- if [[ "$ROS_DISTRO" == "kinetic" ]]; then git checkout med18; fi
- if [[ "$ROS_DISTRO" == "melodic" ]]; then git checkout med18_gazebo9; fi
- cd ~/catkin_ws/src/BebopS
- if [[ "$ROS_DISTRO" == "melodic" ]]; then git checkout dev/gazebo9; fi
- cd ~/catkin_ws
- rosdep install --from-paths src -i
- catkin build
- echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
- source ~/.bashrc