diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..09bba37 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +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: Setup + run: ./install_dependencies.sh + - 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/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) 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/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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..eccc6c0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +cmakelang