From 53bc8743ffb2c5b951f5c79b50c8f5984ecb729a Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Wed, 25 Nov 2020 16:21:55 +0100 Subject: [PATCH 1/3] add github actions --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ Makefile | 11 +++++++++++ README.md | 5 +++++ requirements.txt | 1 + 4 files changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 Makefile create mode 100644 requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..76117f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: [push, pull_request] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Check + run: make check + + ros: + runs-on: ubuntu-latest + container: ros:${{ matrix.ros-version }}-robot + strategy: + matrix: + ros-version: [melodic, noetic] + steps: + - uses: actions/checkout@v2 + - name: Init Workspace + run: | + mkdir -p $GITHUB_WORKSPACE/../catkin_ws/src + cd $GITHUB_WORKSPACE/../catkin_ws/src + ln -s $GITHUB_WORKSPACE + cd .. + catkin init + - name: Build, Test, Lint + shell: bash + run: | + source /opt/ros/${{ matrix.ros-version }}/setup.bash + cd $GITHUB_WORKSPACE/../catkin_ws && + catkin build --summarize --no-status --force-color diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a728adc --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +file_finder = find . -type f \( $(1) \) -not \( -path '*/venv/*' -o -path '*/build/*' -o -path '*/cmake-build-debug/*' \) + +CMAKE_FILES = $(call file_finder,-name "*.cmake" -o -name "CMakeLists.txt") + +check: check_format + +format: + $(CMAKE_FILES) | xargs cmake-format -i + +check_format: + $(CMAKE_FILES) | xargs cmake-format --check diff --git a/README.md b/README.md index 825aae9..989876e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # ros-carla-msgs + +[![Actions Status](https://github.com/carla-simulator/ros-carla-msgs/workflows/CI/badge.svg)](https://github.com/carla-simulator/ros-carla-msgs) +[![GitHub](https://img.shields.io/github/license/carla-simulator/ros-carla-msgs)](https://github.com/carla-simulator/ros-carla-msgs/blob/master/LICENSE) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/carla-simulator/ros-carla-msgs)](https://github.com/carla-simulator/ros-carla-msgs/releases/latest) + Official ROS messages for CARLA. Use them in conjunction with [CARLA ROS bridge](https://github.com/carla-simulator/ros-bridge). diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..eccc6c0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +cmakelang From d9d90d3dd218e33800eb7c121d6db7c429dc2a59 Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Wed, 25 Nov 2020 16:23:20 +0100 Subject: [PATCH 2/3] apply cmake format --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b1f31a..a0f23e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,8 @@ if(${ROS_VERSION} EQUAL 1) generate_messages(DEPENDENCIES std_msgs geometry_msgs diagnostic_msgs) - catkin_package(CATKIN_DEPENDS message_runtime std_msgs geometry_msgs diagnostic_msgs) + catkin_package(CATKIN_DEPENDS message_runtime std_msgs geometry_msgs + diagnostic_msgs) elseif(${ROS_VERSION} EQUAL 2) From ddaf20bb8b198076effc395c2a96430f13422e0b Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Wed, 25 Nov 2020 16:29:26 +0100 Subject: [PATCH 3/3] add installation script --- .github/workflows/ci.yml | 2 ++ install_dependencies.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 install_dependencies.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76117f8..09bba37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,8 @@ jobs: ros-version: [melodic, noetic] steps: - uses: actions/checkout@v2 + - name: Setup + run: ./install_dependencies.sh - name: Init Workspace run: | mkdir -p $GITHUB_WORKSPACE/../catkin_ws/src diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100755 index 0000000..e27a8df --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROS_VERSION=$(rosversion -d) +if [ "$ROS_VERSION" = "noetic" ]; then + PYTHON_SUFFIX=3 +else + PYTHON_SUFFIX="" +fi + +sudo apt-get update +sudo apt-get install --no-install-recommends -y \ + python$PYTHON_SUFFIX-osrf-pycommon \ + python$PYTHON_SUFFIX-catkin-tools