forked from PX4/PX4-Avoidance
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
89 lines (82 loc) · 3.59 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
# Based on https://github.com/felixduvallet/ros-travis-integration
#
# vim:set ts=2 sw=2 et:
language: C++
matrix:
include:
- dist: xenial
env: ROS_DISTRO=kinetic
- dist: bionic
env: ROS_DISTRO=melodic
sudo: required
compiler:
- gcc
cache:
directories:
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
cache:
- apt
- ccache
env:
global:
- ROS_CI_DESKTOP="$(lsb_release -cs)"
- CI_SOURCE_PATH=$(pwd)
- export COVERALLS_SERVICE_NAME=travis-ci
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"
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt-get update -qq
- sudo apt-get install -y build-essential git valgrind ccache
- sudo apt-get install -y python-rosinstall python-rosinstall-generator python-wstool python-catkin-tools python-rosdep
# Install ROS Kinetic
- sudo apt-get install -y ros-$ROS_DISTRO-ros-base
# Install yaml-cpp ROS package
- sudo apt-get install -y libyaml-cpp-dev
# Install MavLink and Mavros
- sudo apt-get install -y ros-$ROS_DISTRO-mavlink ros-$ROS_DISTRO-mavros-msgs ros-$ROS_DISTRO-mavros ros-$ROS_DISTRO-mavros-extras
# Source environment
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep
- sudo rosdep init
- rosdep update
install:
# Create catkin workspace
- mkdir -p ~/catkin_ws
- cd ~/catkin_ws
- catkin config --init --mkdirs
# Pull source depends
- cd src
- wstool init
# Link the repository we are testing to the new workspace
- ln -s $CI_SOURCE_PATH .
# Install dependency
- cd ~/catkin_ws
- rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -q -y
# Install GeographicLib datasets
- sudo -H mkdir -p /usr/share/geographiclib
- wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
- chmod +x install_geographiclib_datasets.sh
- sudo -H ./install_geographiclib_datasets.sh
before_script:
# Source environment
- source /opt/ros/$ROS_DISTRO/setup.bash
script:
- set -e
- cd ~/catkin_ws
- catkin build
- source ~/catkin_ws/devel/setup.bash
# Check for clang format
- cd src/avoidance
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- (cd tools && ./check_state_machine_diagrams.sh)
- catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release -DCATKIN_ENABLE_TESTING=False -DDISABLE_SIMULATION=ON && catkin build
- catkin config --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCATKIN_ENABLE_TESTING=True && catkin build avoidance local_planner global_planner safe_landing_planner --no-deps -v -i --catkin-make-args tests
- status=0 && for f in ~/catkin_ws/devel/lib/*/*-test; do valgrind --leak-check=full --track-origins=yes --error-exitcode=1 $f || exit 1; done
- if [ $ROS_DISTRO == kinetic ]; then sudo apt-get install -y clang-format-3.8; fi
- if [ $ROS_DISTRO == kinetic ]; then (cd tools && ./check_code_format.sh); fi
- if [ $ROS_DISTRO == kinetic ]; then (roscore &) && for f in ~/catkin_ws/devel/lib/*/*-test-roscore; do valgrind --leak-check=full --track-origins=yes --error-exitcode=1 --suppressions=local_planner/test/valgrind_suppressions.sup $f || status=1; done && (if (( $status > 0 )); then exit $status; fi) ; fi
after_success:
- if [ $ROS_DISTRO == kinetic ]; then sudo apt-get install -y lcov && sudo gem install coveralls-lcov; fi
- if [ $ROS_DISTRO == kinetic ]; then (cd ~/catkin_ws/src/avoidance && tools/generate_coverage.sh && coveralls-lcov repo_total.info) ; fi