|
1 | 1 | # Travis Continuous Integration Configuration File For ROS Control Projects |
2 | | -# Author: Dave Coleman |
3 | | -language: |
4 | | - - cpp |
5 | | - - python |
6 | | -python: |
7 | | - - "2.7" |
| 2 | +# Author: Dave Coleman, Enrique Fernandez |
| 3 | +sudo: required |
| 4 | +dist: trusty |
| 5 | +language: generic |
8 | 6 | compiler: |
9 | 7 | - gcc |
| 8 | +env: |
| 9 | + global: |
| 10 | + - ROS_DISTRO=jade |
| 11 | + |
10 | 12 | notifications: |
11 | 13 | email: |
12 | 14 | recipients: |
13 | 15 | |
14 | 16 | |
| 17 | + |
15 | 18 | on_success: change #[always|never|change] # default: change |
16 | 19 | on_failure: change #[always|never|change] # default: always |
17 | | -before_install: # Use this to prepare the system to install prerequisites or dependencies |
18 | | - # Define some config vars |
19 | | - - export ROS_DISTRO=hydro |
| 20 | + |
| 21 | +before_install: |
20 | 22 | - export CI_SOURCE_PATH=$(pwd) |
21 | 23 | - export REPOSITORY_NAME=${PWD##*/} |
22 | 24 | - echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME" |
23 | | - - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' |
| 25 | + # Add ROS repositories |
| 26 | + - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > |
| 27 | + /etc/apt/sources.list.d/ros-latest.list' |
24 | 28 | - wget http://packages.ros.org/ros.key -O - | sudo apt-key add - |
25 | 29 | - sudo apt-get update -qq |
26 | | - - sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin ros-$ROS_DISTRO-ros |
27 | | - # Setup rosdep |
28 | | - - sudo rosdep init |
| 30 | + # Install and initialize rosdep |
| 31 | + - sudo apt-get install -qq -y python-dev |
| 32 | + python-catkin-pkg |
| 33 | + python-rosdep |
| 34 | + python-wstool |
| 35 | + ros-$ROS_DISTRO-catkin |
| 36 | + ros-$ROS_DISTRO-ros |
| 37 | + python-rosinstall |
| 38 | + python-catkin-tools |
| 39 | + python-catkin-pkg |
| 40 | + python-rospkg |
| 41 | + python-vcstools |
| 42 | + - sudo `which rosdep` init |
29 | 43 | - rosdep update |
30 | | -install: # Use this to install any prerequisites or dependencies necessary to run your build |
| 44 | + # Use rosdep to install dependencies |
| 45 | + - rosdep install -y -q --from-paths ./ --rosdistro $ROS_DISTRO |
| 46 | + |
| 47 | +install: |
31 | 48 | # Create workspace |
32 | | - - mkdir -p ~/ros/ws_ros_controls/src |
33 | | - - cd ~/ros/ws_ros_controls/src |
| 49 | + - mkdir -p ~/ros/ws_$REPOSITORY_NAME |
| 50 | + - cd ~/ros/ws_$REPOSITORY_NAME |
| 51 | + - catkin config --init --mkdirs |
| 52 | + - cd src |
34 | 53 | - wstool init . |
35 | 54 | # Download non-debian stuff |
36 | 55 | - wstool merge https://raw.github.com/ros-controls/ros_control/$ROS_DISTRO-devel/ros_control.rosinstall |
37 | 56 | - wstool update |
38 | | - # Delete the ros_control.rosinstall version of this repo and use the one of the branch we are testing |
| 57 | + # Delete the ros_control.rosinstall version of this repo and use the one of |
| 58 | + # the branch we are testing |
39 | 59 | - rm -rf $REPOSITORY_NAME |
40 | | - - ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace |
41 | | - - cd ../ |
| 60 | + # Link the repo we are testing to the new workspace |
| 61 | + - ln -s $CI_SOURCE_PATH . |
| 62 | + - cd .. |
42 | 63 | # Install dependencies for source repos |
43 | | - - rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y |
44 | | -before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc. |
45 | | - - source /opt/ros/$ROS_DISTRO/setup.bash |
46 | | -script: # All commands must exit with code 0 on success. Anything else is considered failure. |
47 | | - - catkin_make -j2 |
| 64 | + - rosdep install -y -q --from-paths src --ignore-src --rosdistro $ROS_DISTRO |
| 65 | + |
| 66 | +before_script: |
| 67 | + - source /opt/ros/$ROS_DISTRO/setup.bash |
| 68 | + - rospack profile |
| 69 | + |
| 70 | +script: |
| 71 | + - cd ~/ros/ws_$REPOSITORY_NAME |
| 72 | + - catkin build -j8 --no-status --summary |
| 73 | + # Run tests |
| 74 | + # Note that we have to run only 1 test at a time to ensure that rostest |
| 75 | + # instances don't collide |
| 76 | + - catkin run_tests -j1 --no-status --summary |
| 77 | + # Note that catkin run_tests always returns 0, so we use catkin_test_results |
| 78 | + # to check for errors; see: https://github.com/catkin/catkin_tools/issues/245 |
| 79 | + - catkin_test_results |
48 | 80 |
|
0 commit comments