-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
63 lines (60 loc) · 2.29 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
sudo: required
dist: trusty
language: generic
env:
- ROS_DISTRO=indigo
- ROS_DISTRO=jade
matrix:
allow_failures:
- env: ROS_DISTRO=jade
# Install system dependencies, namely ROS.
before_install:
# Define some config vars.
- export ROS_CI_DESKTOP=`lsb_release -cs` # e.g. [precise|trusty]
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- export ROS_PARALLEL_JOBS='-j8 -l6'
# Install ROS
- sudo sh -c "echo \"deb http://packages.ros.org/ros-shadow-fixed/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
# Install ROS
- sudo apt-get install -y -q -qq python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin xvfb
- sudo -H pip install 'catkin_tools==0.3.0'
- source /opt/ros/$ROS_DISTRO/setup.bash
# Setup for rosdep
- sudo rosdep init
- rosdep update
# Create a catkin workspace with the package under test.
install:
- mkdir -p ~/catkin_ws/src
# Add the package under test to the workspace.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
# Install all dependencies, using wstool and rosdep.
# wstool looks for a ROSINSTALL_FILE defined in before_install.
before_script:
# source dependencies: install using wstool.
- cd ~/catkin_ws/src
- wstool init
- wstool merge $CI_SOURCE_PATH/mbzirc.rosinstall
- wstool up
# Compile and test.
script:
- source /opt/ros/$ROS_DISTRO/setup.bash
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y -q -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO
# build packages
- catkin build -p1 -j1 --no-status --summarize
- source ~/catkin_ws/devel/setup.bash
# run tests
- xvfb-run -a --server-args="-screen 0 800x600x24" catkin build --catkin-make-args run_tests -- -p1 -j1 --limit-status-rate 0.017 --summarize $REPOSITORY_NAME --no-deps
- catkin_test_results --all --verbose build
- catkin clean -b
# build to install space
- catkin config --install
- catkin build -p1 -j1 --no-status --summarize
after_failure:
- find ${HOME}/.ros/test_results -type f -exec echo "== {} ==" \; -exec cat {} \;
- for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done