Skip to content

Commit

Permalink
Merge branch 'master' of github.com:robofit/artable-msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZdenekM committed Mar 27, 2018
2 parents 1bef01f + 00a2af0 commit 3414e78
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 1 deletion.
106 changes: 106 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Generic .travis.yml file for running continuous integration on Travis-CI with
# 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.
#
# We handle two types of package dependencies:
# - packages (ros and otherwise) available through apt-get. These are installed
# using rosdep, based on the information in the ROS package.xml.
# - dependencies that must be checked out from source. These are handled by
# 'wstool', and should be listed in a file named dependencies.rosinstall.
#
# There are two variables you may want to change:
# - ROS_DISTRO (default is indigo). Note that packages must be available for
# ubuntu 14.04 trusty.
# - ROSINSTALL_FILE (default is dependencies.rosinstall inside the repo
# root). This should list all necessary repositories in wstool format (see
# the ros wiki). If the file does not exists then nothing happens.
#
# See the README.md for more information.
#
# Author: Felix Duvallet <felixd@gmail.com>

# NOTE: 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:
- python
cache:
- apt

# By default travis runs all python code in a virtualenv that does not contain
# the packages installed with apt-get. As this is essential (pip doesn't contain
# all the necessary ROS python packages), tell travis-ci to use the system-wide
# python packages.
virtualenv:
system_site_packages: true

# 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'

################################################################################

# 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 python-catkin-lint
- source /opt/ros/$ROS_DISTRO/setup.bash
# Prepare rosdep to install dependencies.
- sudo rosdep init
- rosdep update
- sudo pip install catkin-tools

# Create a catkin workspace with the package under integration.
install:
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/src
# Create the devel/setup.bash (run catkin_make with an empty workspace) and
# source it to set the path variables.
- cd ~/catkin_ws
- catkin init
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .

# Compile and test.
script:
- cd ~/catkin_ws/
# - catking config --install
- catkin build
- source devel/setup.bash
- catkin_lint $CI_SOURCE_PATH
- cd ~/catkin_ws/src/artable-msgs
- chmod +x run_tests.sh
- ./run_tests.sh

after_failure:
- cd ~/catkin_ws
- find build/ -iwholename "*/test_results/*.xml" -exec cat {} \;
- find build/ -iwholename "*/Testing/Temporary/LastTest.log" -exec cat {} \;
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# artable-msgs
# artable-msgs

[![Build Status](https://travis-ci.org/robofit/artable-msgs.svg?branch=master)](https://travis-ci.org/robofit/artable-msgs)
19 changes: 19 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e
set -o pipefail

prefix="./"
repo_dir=$PWD

for dir in $(find ./ -maxdepth 2 -type d -name 'art_*')
do
dir=${dir#$prefix}
if [ -f "$dir/package.xml" ]; then
echo "Running test for package:" $dir
cd "$dir"
catkin run_tests --no-deps --this
catkin_test_results ~/catkin_ws/build/${PWD##*/}
cd $repo_dir
fi
done

0 comments on commit 3414e78

Please sign in to comment.