-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
92 lines (84 loc) · 3.54 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
################################################################################
cache:
- apt
# Build all valid Ubuntu/ROS combinations available on Travis VMs.
language: cpp
os: linux
matrix:
include:
- name: "Bionic melodic AMD64"
arch: amd64
dist: bionic
env: ROS_DISTRO=melodic
- name: "Bionic melodic ARM64"
arch: arm64
dist: bionic
env: ROS_DISTRO=melodic
- name: "Focal noetic AMD64"
arch: amd64
dist: focal
env: ROS_DISTRO=noetic
- name: "Focal noetic ARM64"
arch: arm64
dist: focal
env: ROS_DISTRO=noetic
# 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)
- 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 apt-get install dpkg curl
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
- sudo apt-get update -qq
- if [ $ROS_DISTRO = noetic ]; then PYTHON=python3; else PYTHON=python; fi
- sudo apt-get install -y $PYTHON-catkin-pkg $PYTHON-catkin-tools $PYTHON-rosdep $PYTHON-wstool ros-$ROS_DISTRO-ros-base ros-$ROS_DISTRO-code-coverage
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
- catkin init
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin config -j 2 # To avoid out-of-memory errors on build
- CXXFLAGS=-Werror catkin build
- 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
before_script:
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
# Compile and test (mark the build as failed if any step fails).
#
# 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
- CXXFLAGS=-Werror catkin build
# Run the tests, ensuring the path is set correctly.
- source devel/setup.bash
- catkin run_tests && catkin_test_results
# Generate coverage
- catkin clean -y
- catkin build ros_babel_fish -DENABLE_COVERAGE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
- catkin build ros_babel_fish --no-deps -DENABLE_COVERAGE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -v --catkin-make-args ros_babel_fish_coverage
- bash <(curl -s https://codecov.io/bash) -f ./build/ros_babel_fish/ros_babel_fish_coverage.info -R ./src/ros_babel_fish