Skip to content
Permalink
Browse files

Refactor CI scripts (#6)

  • Loading branch information...
at-wat committed May 23, 2019
1 parent e61f967 commit 4980c8a9cc37724b020a74862b99fb8b589184cb
Showing with 22 additions and 77 deletions.
  1. +6 −4 .travis.yml
  2. +5 −3 Dockerfile.indigo → .travis/Dockerfile
  3. +5 −10 .travis/test.sh
  4. +6 −14 CMakeLists.txt
  5. +0 −23 Dockerfile.kinetic
  6. +0 −23 Dockerfile.melodic
@@ -1,4 +1,5 @@
services: docker
language: bash
addons:
apt:
packages:
@@ -8,9 +9,8 @@ env:
global:
- PACKAGE_NAME=mcl_3dl_msgs
matrix:
- ROS_DISTRO_TARGET=melodic
- ROS_DISTRO_TARGET=kinetic
- ROS_DISTRO_TARGET=indigo
- ROS_DISTRO_TARGET=melodic
branches:
only:
- master
@@ -23,8 +23,10 @@ install: true
script:
- docker build
-t mcl-3dl-msgs
-f Dockerfile.${ROS_DISTRO_TARGET}
--pull=true ${TRAVIS_BUILD_DIR} || (gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}] FAILED on ${ROS_DISTRO_TARGET}" "docker build failed"; false)
-f .travis/Dockerfile
--pull=true ${TRAVIS_BUILD_DIR}
--build-arg ROS_DISTRO=${ROS_DISTRO_TARGET}
|| (gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}] FAILED on ${ROS_DISTRO_TARGET}" "docker build failed"; false)
- docker run --rm -it
-e TRAVIS_PULL_REQUEST
-e TRAVIS_PULL_REQUEST_SLUG
@@ -1,19 +1,21 @@
FROM ros:indigo-ros-core
ARG ROS_DISTRO=kinetic
FROM ros:${ROS_DISTRO}-ros-core

RUN apt-get -qq update \
&& apt-get install -y --no-install-recommends \
build-essential \
libxml2-utils \
python-pip \
sudo \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install gh-pr-comment catkin_lint

RUN rosdep update \
&& mkdir -p /catkin_ws/src \
&& cd /catkin_ws/src \
&& bash -c ". /opt/ros/${ROS_DISTRO}/setup.bash && catkin_init_workspace && cd .. && catkin_make"
&& . /opt/ros/${ROS_DISTRO}/setup.sh \
&& catkin_init_workspace

COPY ./package.xml /catkin_ws/src/mcl_3dl_msgs/package.xml
RUN apt-get -qq update \
@@ -1,22 +1,17 @@
#!/bin/bash

set -o errexit
set -o verbose

pip install gh-pr-comment catkin_lint

source /opt/ros/${ROS_DISTRO}/setup.bash

cd /catkin_ws


pkgs=`find . -name package.xml | xargs -n1 dirname`
pkgs=$(find . -name package.xml | xargs -n1 dirname)
catkin_lint $pkgs \
|| (gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}] FAILED on ${ROS_DISTRO}" \
"<details><summary>catkin_lint failed</summary>
\`\`\`
`catkin_lint $pkgs 2>&1`
$(catkin_lint $pkgs 2>&1)
\`\`\`
</details>"; false)

@@ -39,15 +34,15 @@ if [ catkin_test_results ];
then
result_text="
\`\`\`
`catkin_test_results --all | grep -v Skipping || true`
$(catkin_test_results --all | grep -v Skipping || true)
\`\`\`
"
else
result_text="
\`\`\`
`catkin_test_results --all | grep -v Skipping || true`
$(catkin_test_results --all | grep -v Skipping || true)
\`\`\`
`find build/test_results/ -name *.xml | xargs -n 1 -- bash -c 'echo; echo \#\#\# $0; echo; echo \\\`\\\`\\\`; xmllint --format $0; echo \\\`\\\`\\\`;'`
$(find build/test_results/ -name *.xml | xargs -n 1 -- bash -c 'echo; echo \#\#\# $0; echo; echo \\\`\\\`\\\`; xmllint --format $0; echo \\\`\\\`\\\`;')
"
fi
catkin_test_results || (gh-pr-comment "[#${TRAVIS_BUILD_NUMBER}] FAILED on ${ROS_DISTRO}" "<details><summary>Test failed</summary>
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
project(mcl_3dl_msgs)

find_package(catkin REQUIRED
COMPONENTS
message_generation
std_msgs
set(MESSAGE_DEPENDS
std_msgs
)

find_package(catkin REQUIRED COMPONENTS message_generation ${MESSAGE_DEPENDS})

add_service_files(
FILES
ResizeParticle.srv
@@ -15,13 +15,5 @@ add_message_files(
FILES
Status.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)

catkin_package(
CATKIN_DEPENDS
message_runtime
std_msgs
)
generate_messages(DEPENDENCIES ${MESSAGE_DEPENDS})
catkin_package(CATKIN_DEPENDS message_runtime ${MESSAGE_DEPENDS})

This file was deleted.

This file was deleted.

0 comments on commit 4980c8a

Please sign in to comment.
You can’t perform that action at this time.