Skip to content

Commit

Permalink
add draft for CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-nhg committed May 26, 2021
1 parent 2a05f19 commit 453fbe9
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_foxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: FOXY ros-model-extractors

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ros-model-extractors
- name: Build the docker container for foxy
run: |
pushd ros-model-extractors
docker build --tag=haros_foxy -f foxy/Dockerfile .
- name: Analyse the ROS package sick_safetyscanners2 for foxy
run: |
pushd ros-model-extractors
docker run haros_foxy:latest /test.sh foxy
21 changes: 21 additions & 0 deletions .github/workflows/build_melodic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: MELODIC ros-model-extractors

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ros-model-extractors
- name: Build the docker container for melodic
run: |
pushd ros-model-extractors
docker build --tag=haros_melodic -f melodic/Dockerfile .
- name: Analyse the ROS package hokuyo_node for melodic
run: |
pushd ros-model-extractors
docker run haros_melodic:latest /test.sh hokuyo_node melodic
21 changes: 21 additions & 0 deletions .github/workflows/build_noetic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: NOETIC ros-model-extractors

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ros-model-extractors
- name: Build the docker container for noetic
run: |
pushd ros-model-extractors
docker build --tag=haros_noetic -f noetic/Dockerfile .
- name: Analyse the ROS package cob_sick_s300 for noetic
run: |
pushd ros-model-extractors
docker run haros_noetic:latest /test.sh noetic
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# ros-model-extractors

[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

[![MELODIC build status](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_melodic.yml/badge.svg)](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_melodic.yml)
[![NOETIC ros-model-extractors](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_noetic.yml/badge.svg)](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_noetic.yml)
[![FOXY build status](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_foxy.yml/badge.svg)](https://github.com/ipa320/ros-model-extractors/actions/workflows/build_foxy.yml)


Technical Maintainer: [**ipa-nhg**](https://github.com/ipa-nhg/) (**Nadia Hammoudeh Garcia**, **Fraunhofer IPA**) - **[email protected]**

This repository contains the HAROS framework plugin to automatically generate models according to the DSLs defined for RosModel.
Expand Down
1 change: 1 addition & 0 deletions foxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ENV PYTHON_VERSION 3

COPY haros_runner.sh /
COPY ros_model_extractor.py /
COPY test.sh /

EXPOSE 4000

Expand Down
1 change: 1 addition & 0 deletions melodic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ENV PYTHON_VERSION 2

COPY haros_runner.sh /
COPY ros_model_extractor.py /
COPY test.sh /

EXPOSE 4000

Expand Down
1 change: 1 addition & 0 deletions noetic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ENV PYTHON_VERSION 3

COPY haros_runner.sh /
COPY ros_model_extractor.py /
COPY test.sh /

EXPOSE 4000

Expand Down
66 changes: 66 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# Arguments:
# 1: Distro to test

hokuyo_model="PackageSet {
CatkinPackage hokuyo_node {
Artifact hokuyo_node {
Node { name hokuyo_node
Publishers {
Publisher { name 'scan' message 'sensor_msgs.LaserScan'}}}
}}}"

if [ "${1}" = "melodic" ]; then
./haros_runner.sh hokuyo_node hokuyo_node node . /root/ws https://github.com/ros-drivers/hokuyo_node
if [ "$(echo "$hokuyo_model" | sed -E 's,\\t|\\r|\\n,,g')" != "$(cat /root/ws/hokuyo_node.ros | sed -E 's,\\t|\\r|\\n,,g')" ] ;then
echo "Test failed; the auto-generated model is different to the expected one:"
echo "$hokuyo_model"
exit 1
fi
fi

s300_model="PackageSet {
CatkinPackage cob_sick_s300 {
Artifact cob_sick_s300 {
Node { name cob_sick_s300
Publishers {
Publisher { name '/diagnostics' message 'diagnostic_msgs.DiagnosticArray'},
Publisher { name 'scan_standby' message 'std_msgs.Bool'},
Publisher { name 'scan' message 'sensor_msgs.LaserScan'}}}
}}}"

if [ "${1}" = "noetic" ]; then
./haros_runner.sh cob_sick_s300 cob_sick_s300 node . /root/ws https://github.com/ipa320/cob_driver
if [ "$(echo "$s300_model" | tr -d '[:space:]')" != "$(cat /root/ws/cob_sick_s300.ros | tr -d '[:space:]')" ] ;then
:
else
echo "Test failed; the auto-generated model is different to the expected one:"
echo "$s300_model"
exit 1
fi
fi

safetyscanner_model="PackageSet {
CatkinPackage sick_safetyscanners2 {
Artifact sick_safetyscanners2_node {
Node { name sick_safetyscanners2_node
ServiceServers {
ServiceServer { name 'field_data' service 'sick_safetyscanners2_interfaces.FieldData'}}
Publishers {
Publisher { name 'scan' message 'sensor_msgs.LaserScan'},
Publisher { name 'output_paths' message 'sick_safetyscanners2_interfaces.OutputPaths'},
Publisher { name 'raw_data' message 'sick_safetyscanners2_interfaces.RawMicroScanData'},
Publisher { name 'extended_scan' message 'sick_safetyscanners2_interfaces.ExtendedLaserScan'}}}
}}}"

if [ "${1}" = "foxy" ]; then
./haros_runner.sh sick_safetyscanners2 sick_safetyscanners2_node node . /root/ws https://github.com/SICKAG/sick_safetyscanners2
if [ "$safetyscanner_model" == "$(cat /root/ws/sick_safetyscanners2_node.ros)" ] ;then
:
else
echo "Test failed; the auto-generated model is different to the expected one:"
echo "$safetyscanner_model"
exit 1
fi
fi

0 comments on commit 453fbe9

Please sign in to comment.