forked from jsk-ros-pkg/jsk_roseus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (70 loc) · 5.07 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
language:
- cpp
- python
python:
- "2.7"
compiler:
- gcc
env:
# - ROS_DISTRO=groovy ROSWS=rosws BUILDER=rosbuild USE_DEB=true
- ROS_DISTRO=groovy ROSWS=rosws BUILDER=rosbuild USE_DEB=false
# - ROS_DISTRO=groovy ROSWS=wstool BUILDER=catkin USE_DEB=true
- ROS_DISTRO=groovy ROSWS=wstool BUILDER=catkin USE_DEB=false
# - ROS_DISTRO=hydro ROSWS=wstool BUILDER=catkin USE_DEB=true
- ROS_DISTRO=hydro ROSWS=wstool BUILDER=catkin USE_DEB=false
before_install: # Use this to prepare the system to install prerequisites or dependencies
# Define some config vars
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
- sudo sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu precise 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 -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- if [ $ROSWS == rosws ]; then sudo apt-get install -qq -y python-rosinstall ; fi
- if [ $BUILDER == rosbuild ]; then sudo apt-get install -qq -y ros-$ROS_DISTRO-rosmake ; fi
# MongoDB hack - I don't fully understand this but its for moveit_warehouse
- sudo apt-get remove -y mongodb mongodb-10gen
- sudo apt-get install -y mongodb-clients mongodb-server -o Dpkg::Options::="--force-confdef" # default actions
# Setup rosdep
- sudo rosdep init
- rosdep update; while [ $? != 0 ]; do sleep 1; rosdep update; done
install: # Use this to install any prerequisites or dependencies necessary to run your build
# Create workspace
- mkdir -p ~/ros/ws_$REPOSITORY_NAME/src
- cd ~/ros/ws_$REPOSITORY_NAME/src
- if [ $USE_DEB == false -o $BUILDER == rosbuild ]; then $ROSWS init . ; fi
- if [ $USE_DEB == false ]; then $ROSWS merge file://$CI_SOURCE_PATH/.rosinstall ; fi
- if [ $USE_DEB == false -o $BUILDER == rosbuild ]; then if [ $ROSWS == rosws ]; then $ROSWS merge /opt/ros/$ROS_DISTRO/.rosinstall; fi ; fi
- if [ $USE_DEB == false ]; then sed -i "s@^\(.*github.com/$TRAVIS_REPO_SLUG.*\)@#\1@" .rosinstall ; fi # comment out current repo
- if [ $USE_DEB == false ]; then $ROSWS update ; fi
- if [ $USE_DEB == false -o $BUILDER == rosbuild ]; then $ROSWS set $REPOSITORY_NAME http://github.com/$TRAVIS_REPO_SLUG --git -y ; fi
- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
- cd ../
# Install dependencies for source repos
- find -L src -name package.xml -exec dirname {} \; | xargs -n 1 -i find {} -name manifest.xml | xargs -n 1 -i mv {} {}.deprecated # rename manifest.xml for rosdep install
- rosdep install -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
- find -L src -name manifest.xml.deprecated | xargs -n 1 -i dirname {} | xargs -n 1 -i ln -sf `pwd`/{}/manifest.xml.deprecated `pwd`/{}/manifest.xml # rename manifest.xml for rosdep install
- find . \! -path "*/.*" -type f | xargs egrep -i "(hoge|fuga)" ; if [ $? == 0 ]; then exit 1; fi
before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc.
- source /opt/ros/$ROS_DISTRO/setup.bash
- if [ $BUILDER == rosbuild ]; then source src/setup.bash ; fi
- if [ $BUILDER == rosbuild ]; then rospack profile ; fi
script: # All commands must exit with code 0 on success. Anything else is considered failure.
# for catkin
- if [ $BUILDER == catkin ]; then catkin_make -j8 -l8 ; fi
- if [ $BUILDER == catkin ]; then export TARGET_PKG=`find build/$REPOSITORY_NAME -name Makefile -print | sed s@.*/\\\\\([^\/]*\\\\\)/Makefile@\\\1@g` ; fi
- if [ $BUILDER == catkin ]; then catkin_make test --pkg $TARGET_PKG -j8 -l8 ; fi
- if [ $BUILDER == catkin ]; then find build -name LastTest.log -exec echo "==== {} ====" \; -exec cat {} \; ; fi
- if [ $BUILDER == catkin ]; then catkin_make -j8 -l8 install ; fi
- if [ $BUILDER == catkin ]; then rm -fr devel src build ; fi
- if [ $BUILDER == catkin ]; then source install/setup.bash ; fi
- if [ $BUILDER == catkin ]; then export EXIT_STATUS=0; for pkg in $TARGET_PKG; do [ "`find install/share/$pkg -iname '*.test'`" == "" ] && echo "[$pkg] No tests ware found!!!" || find install/share/$pkg -iname "*.test" -print0 | xargs -0 -n1 rostest || export EXIT_STATUS=$?; done; [ $EXIT_STATUS == 0 ] ; fi
# for rosbuild
- if [ $BUILDER == rosbuild ]; then rosmake -a --profile --pjobs=8 ; fi
- if [ $BUILDER == rosbuild ]; then export TARGET_PKG=`find -L src | grep $REPOSITORY_NAME | grep /build/Makefile$ | sed s@.*/\\\\\([^\/]*\\\\\)/build/Makefile@\\\1@g` ; fi
- if [ $BUILDER == rosbuild ]; then rosmake --test-only $TARGET_PKG --pjobs=8 ; fi
after_failure:
- if [ $BUILDER == rosbuild ]; then find ${HOME}/.ros/rosmake/ -type f -exec echo "=== {} ===" \; -exec cat {} \; ; fi
- find ${HOME}/.ros/test_results -type f -exec echo "=== {} ===" \; -exec cat {} \;
- for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done