-
Notifications
You must be signed in to change notification settings - Fork 53
/
.travis.yml
118 lines (110 loc) · 4.87 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
sudo: required
cache:
- apt
# Build all valid Ubuntu/ROS combinations available on Travis VMs.
language: generic
matrix:
include:
- name: "Xenial kinetic"
dist: xenial
env: ROS_DISTRO=kinetic
# 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. [trusty|xenial|...]
- 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"
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt-get update -qq
- sudo apt-get update
- sudo apt-get install python-catkin-pkg python-catkin-tools python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- sudo apt-get install -y python-rosinstall python-rosinstall-generator build-essential
- sudo apt-get install python-pip python-dev
- sudo apt-get install -y ros-$ROS_DISTRO-octomap-msgs
- source /opt/ros/$ROS_DISTRO/setup.bash
- echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
- source ~/.bashrc
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update --include-eol-distros # Support EOL distros.
# 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 .
- pip install codecov --user
# 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
# Gmock
- sudo apt-get install libgtest-dev
- sudo apt-get install google-mock
- cd /usr/src/gmock
- sudo mkdir build
- cd build
- sudo cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
- sudo make -j
- sudo cp libgmock* /usr/local/lib/.
- sudo cp gtest/libgtest* /usr/local/lib/.
#- sudo git clone https://github.com/google/googletest.git
#- cd googletest
#- sudo cp -a googlemock/include/gmock /usr/include
#- sudo cp -a googletest/include/gtest /usr/include
#- sudo mkdir build
#- cd build
#- sudo cmake -DBUILD_SHARED_LIBS=ON -DBUILD_GTEST=ON -DBUILD_GMOCK=ON -DINSTALL_GTEST=ON -DINSTALL_GMOCK=ON ..
#- sudo make install
# 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
- sudo cp src/amcl3d/FindGMock.cmake /usr/share/cmake-3.5/Modules/
- cd ~/catkin_ws/src/amcl3d/amcl3d/
- mkdir -p data/map
- cd data/map
- wget https://github.com/fada-catec/amcl3d/releases/download/v1.1.0/mapfile_complete.bt
- wget https://github.com/fada-catec/amcl3d/releases/download/v1.1.0/mapfile_complete_ot.ot
- cd ~/catkin_ws
- catkin_make
# Run the tests, ensuring the path is set correctly.
- source devel/setup.bash
- catkin_make tests
- rm -rf build devel
- catkin config --cmake-args -DCMAKE_CXX_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_C_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXE_LINKER_FLAGS="-lgcov"
- catkin build
- catkin run_tests -i && catkin_test_results
- cd src/amcl3d
- codecov --gcov-root ~/catkin_ws/build/