forked from UMD-AMAV/TerpCopter2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (103 loc) · 5.07 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
# Generic .travis.yml file for running continuous integration on Travis-CI for
# any ROS package.
#
#
# 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.
#
# 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 trusty (14.04) with sudo privileges.
dist: trusty
sudo: required
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_DISTRO=indigo
- 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'
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "cWPKo30HMePj3SyZEzun9JeMHnFVTVa/mVAQw6JQvo6urbcZllUOmZOdj64tpMwsJh0WniZ2MnzyC1e0JQt+DxTdidqGRPXLAHrj0iGP8Xkjhq5G26brhiclfBkdWdQ6UnbA0VXLFKD/m3gRHV6VEJOD9wk9b562izsQBaLTQczdYffca4JfxLsfP7Mx0O7hBEnN0I+ywMxq/ZjFe2hBZpuFkAyaRhNBYtcEeQ0o1zfOgOt63ORZerk9te3sEILgmzSs3Y8O8VfUhxcW53GOH2q4NmkRfjh/jwDldR9jrjjGHN7MCr/oozG3G7UZBdTOUCqCuuEgwybtsUkISMExOBvVliRloI3AStEfoZSbUOGM0ICoYFaWpyTrHID5LD5tkiHu67Tn5yGChe5xA81HitvOpbGAe1VNo2mOFpXBTm6kBwLXZaguCSxiUWgQAtoyqOH/L+A+yod8Q+J4pIQkZpgdU5+vP75e0aV/ov1H+u17m9WYGU4ptkFhf6TVknFNNsSQvcAy7y+YOxsoLtAVT88bGwE4yA2Z2+4LkfJkL/iSn27rLptKnHmmEVSAKoq6gIOheXP5V5Q3uhxndtVjnk80JBxNOtuQ47PRnpUjDxy3eyFQCYkb1twZkTAWJO9MyTsrkVA4MYnTpwDmFvcUHmkWDIEs1vSVPKaCvXed7/A=""
################################################################################
# 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 -
- sudo apt-get update -qq
- sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- sudo apt-get install ros-indigo-opencv3 ros-indigo-camera-info-manager ros-indigo-cv-bridge libeigen3-dev ros-indigo-mavros
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin_init_workspace
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin_make
- source devel/setup.bash
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .
# Install all dependencies, using wstool first and rosdep second.
# wstool looks for a ROSINSTALL_FILE defined in the environment variables.
before_script:
# source dependencies: install using wstool.
- cd ~/catkin_ws/src
- wstool init
- if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
- wstool up
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
# Do static code analysis with coverity
addons:
coverity_scan:
project:
name: "saimouli/TerpCopter2018"
description: "UMD's Autopilot Software for AMAV Competition"
notification_email: [email protected]
build_command_prepend: "cd ~/catkin_ws && rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO"
build_command: "catkin_make"
branch_pattern: master
# Compile and test (mark the build as failed if any step fails). If the
# CATKIN_OPTIONS file exists, use it as an argument to catkin_make, for example
# to blacklist certain packages.
#
# NOTE on testing: `catkin_make run_tests` will show the output of the tests
# (gtest, nosetest, etc..) but always returns 0 (success) even if a test
# fails. Running `catkin_test_results` aggregates all the results and returns
# non-zero when a test fails (which notifies Travis the build failed).
script:
- source /opt/ros/$ROS_DISTRO/setup.bash
- cd ~/catkin_ws
- catkin_make $( [ -f $CATKIN_OPTIONS ] && cat $CATKIN_OPTIONS )
# Run the tests, ensuring the path is set correctly.
- source devel/setup.bash
- catkin_make run_tests && catkin_test_results