diff --git a/.travis.yml b/.travis.yml index ecbe811..f6d22e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,69 +1,173 @@ -dist: trusty sudo: required -compiler: - - gcc -language: node_js -node_js: - - "6" - - "7" - - "8" +dist: xenial +services: + - docker + +addons: + apt: + packages: + - docker-ce env: global: - - ROS_DISTRO=indigo - ROS_CI_DESKTOP="`lsb_release -cs`" # e.g. [precise|trusty|...] - CI_SOURCE_PATH=$(pwd) + - CATKIN_WS_PATH=/root/catkin_ws + - DOCKER_SOURCE_PATH=/root/app - ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall - CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options - 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 + matrix: + - distro: trusty + docker_tag: "0.0.2" + node_version: 6 + ROS_DISTRO: indigo + - distro: trusty + docker_tag: "0.0.2" + node_version: 7 + ROS_DISTRO: indigo + - distro: trusty + docker_tag: "0.0.2" + node_version: 8 + ROS_DISTRO: indigo + - distro: xenial + docker_tag: "0.0.3" + node_version: 6 + ROS_DISTRO: kinetic + - distro: xenial + docker_tag: "0.0.3" + node_version: 7 + ROS_DISTRO: kinetic + - distro: xenial + docker_tag: "0.0.3" + node_version: 8 + ROS_DISTRO: kinetic + - distro: bionic + docker_tag: "0.0.5" + node_version: 6 + ROS_DISTRO: melodic + - distro: bionic + docker_tag: "0.0.5" + node_version: 7 + ROS_DISTRO: melodic + - distro: bionic + docker_tag: "0.0.5" + node_version: 8 + ROS_DISTRO: melodic + branches: only: - kinetic-devel # Install system dependencies, namely a very barebones ROS setup. before_install: - - sudo apt-get install -y dpkg # to upgrade to dpkg >= 1.17.5ubuntu5.8, which fixes https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/1730627 - - sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list" - - sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 - - sudo apt-get update -qq - - sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin - - source /opt/ros/$ROS_DISTRO/setup.bash - # Prepare rosdep to install dependencies. - - sudo rosdep init - - rosdep update + - docker pull boldt/base-ubuntu-nvm-node-npm:${docker_tag} + - > + docker run -d -it + -e ROS_REPO + -e ROS_DISTRO + -e ROSINSTALL_FILE + -e ROS_CI_DESKTOP + -e CATKIN_WS_PATH + -e CATKIN_OPTIONS + -e CI_SOURCE_PATH + -e PYTHONPATH + -e DOCKER_SOURCE_PATH + -e node_version + -v $(pwd):${DOCKER_SOURCE_PATH} + --name build + boldt/base-ubuntu-nvm-node-npm:${docker_tag} + - docker ps -a # Create a catkin workspace with the package under integration. install: - - mkdir -p ~/catkin_ws/src - - cd ~/catkin_ws/src - - catkin_init_workspace - # Create the devel/setup.bash (run catkin_make with an empty workspace) and - # source it to set the path variables. - - cd ~/catkin_ws - - catkin_make - - source devel/setup.bash - - # Install required message packages - - git clone https://github.com/ros/std_msgs.git src/std_msgs - - git clone https://github.com/ros/common_msgs src/common_msgs - - git clone https://github.com/RethinkRobotics-opensource/test_msgs.git src/test_msgs - - git clone https://github.com/ros/ros_comm_msgs.git src/ros_comm_msgs - # Install all dependencies, using wstool first and rosdep second. - # wstool looks for a ROSINSTALL_FILE defined in the environment variables. - - cd ~/catkin_ws/src - - wstool init - - if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi - - wstool up - # package depdencies: install using rosdep. - - cd ~/catkin_ws - - rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO - - source devel/setup.bash - + - > + docker exec build bash -c + 'sudo apt-get install -y dpkg' + # to upgrade to dpkg >= 1.17.5ubuntu5.8, which fixes https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/1730627 + - > + docker exec build bash -c + 'sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"' + - > + docker exec build bash -c + 'sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116;' + - > + docker exec build bash -c + 'sudo apt-get update -qq;' + - > + docker exec build bash -c + 'sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin;' + - > + docker exec build bash -c + 'source /opt/ros/$ROS_DISTRO/setup.bash' + # Prepare rosdep to install dependencies. + - > + docker exec build bash -c + 'sudo rosdep init;' + - > + docker exec build bash -c + 'rosdep update;' + - > + docker exec build bash -c + 'mkdir -p $CATKIN_WS_PATH/src;' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'catkin_init_workspace;' + # Create the devel/setup.bash (run catkin_make with an empty workspace) and + # source it to set the path variables. + - > + docker exec -w $CATKIN_WS_PATH build bash -c + 'catkin_make;' + - > + docker exec -w $CATKIN_WS_PATH build bash -c + 'source devel/setup.bash;' + # Install required message packages + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'git clone https://github.com/ros/std_msgs.git' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'git clone https://github.com/ros/common_msgs' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'git clone https://github.com/RethinkRobotics-opensource/test_msgs.git' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'git clone https://github.com/ros/ros_comm_msgs.git' + # Install all dependencies, using wstool first and rosdep second. + # wstool looks for a ROSINSTALL_FILE defined in the environment variables. + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'wstool init;' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi;' + - > + docker exec -w $CATKIN_WS_PATH/src build bash -c + 'wstool up;' + # package depdencies: install using rosdep. + - > + docker exec -w $CATKIN_WS_PATH build bash -c + 'rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO;' + - > + docker exec -w $CATKIN_WS_PATH build bash -c + 'source devel/setup.bash;' + - > + docker exec -w $CATKIN_WS_PATH build bash -c + 'nvm install $node_version' + script: - - cd $CI_SOURCE_PATH - - npm install - - npm run compile - - npm run generate - - npm test + - > + docker exec -w $DOCKER_SOURCE_PATH build bash -c + 'npm install;' + - > + docker exec -w $DOCKER_SOURCE_PATH build bash -c + 'npm run compile;' + - > + docker exec -w $DOCKER_SOURCE_PATH build bash -c + 'npm run generate;' + - > + docker exec -w $DOCKER_SOURCE_PATH build bash -c + 'npm test;'