From e1ab96a7ee8bfe7f57ba0626e09209778eeac384 Mon Sep 17 00:00:00 2001 From: Patrick Roncagliolo Date: Thu, 7 Dec 2023 12:30:33 +0100 Subject: [PATCH] CI (#1) (#2) Co-authored-by: Fixit-Davide --- .github/workflows/iron.yaml | 39 ++++++++++++++++++++++++++++++++++ .github/workflows/rolling.yaml | 39 ++++++++++++++++++++++++++++++++++ CMakeLists.txt | 5 +++++ README.md | 8 ++++++- package.xml | 7 +++++- 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/iron.yaml create mode 100644 .github/workflows/rolling.yaml diff --git a/.github/workflows/iron.yaml b/.github/workflows/iron.yaml new file mode 100644 index 0000000..34210b8 --- /dev/null +++ b/.github/workflows/iron.yaml @@ -0,0 +1,39 @@ +name: Ubuntu 22.04 Iron Build + +on: + pull_request: + push: + branches: + - iron + +jobs: + Build: + runs-on: self-hosted + container: + image: osrf/ros:iron-desktop-full-jammy + + steps: + - name: Update + run: apt update + + - name: Install PIP + run: apt install -y python3-pip lcov + + - name: Install colcon tools + run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result + + - name: Checkout + uses: actions/checkout@v2 + + - name: Run Tests + uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: iron + import-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Logs + uses: actions/upload-artifact@v1 + with: + name: colcon-logs + path: ros_ws/log + if: always() \ No newline at end of file diff --git a/.github/workflows/rolling.yaml b/.github/workflows/rolling.yaml new file mode 100644 index 0000000..3f2d63e --- /dev/null +++ b/.github/workflows/rolling.yaml @@ -0,0 +1,39 @@ +name: Ubuntu 22.04 Rolling Build + +on: + pull_request: + push: + branches: + - iron + +jobs: + Build: + runs-on: self-hosted + container: + image: osrf/ros:rolling-desktop-full-jammy + + steps: + - name: Update + run: apt update + + - name: Install PIP + run: apt install -y python3-pip lcov + + - name: Install colcon tools + run: python3 -m pip install colcon-lcov-result colcon-coveragepy-result + + - name: Checkout + uses: actions/checkout@v2 + + - name: Run Tests + uses: ros-tooling/action-ros-ci@0.3.5 + with: + target-ros2-distro: rolling + import-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Logs + uses: actions/upload-artifact@v1 + with: + name: colcon-logs + path: ros_ws/log + if: always() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 2314328..3bc87df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,4 +57,9 @@ install(DIRECTORY DESTINATION share/${PROJECT_NAME}/ ) +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + ament_package() diff --git a/README.md b/README.md index 6a846e6..639cb29 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ -# ROS2-systemctl Node: +# ROS2-systemctl Node + +[![Ubuntu 22.04 Iron Build](https://github.com/Fixit-Davide/ros-systemctl/actions/workflows/iron.yaml/badge.svg?branch=iron)](https://github.com/Fixit-Davide/ros-systemctl/actions/workflows/iron.yaml) +[![Ubuntu 22.04 Rolling Build](https://github.com/Fixit-Davide/ros-systemctl/actions/workflows/rolling.yaml/badge.svg?branch=iron)](https://github.com/Fixit-Davide/ros-systemctl/actions/workflows/rolling.yaml) + + **systemctl** is a command line utility that is used to control and manage system services on Linux operating system. This Node enables the communication with **systemctl** using basic ROS2 services (std_srvs::srv::Request). It allows the user to start, stop, restart and visualize the status of a specific system service. + ## How to Use: - In order to function correctly as a normal user, the custom Systemd unit file has to be generated in the `~/.config/systemd/user/` directory. - In the params file the names of the systemd services can be set as a simple list **omitting** the .service extension of the name. diff --git a/package.xml b/package.xml index dcc303c..0ef32ae 100644 --- a/package.xml +++ b/package.xml @@ -15,11 +15,16 @@ builtin_interfaces std_srvs rosidl_default_generators + libsystemd-dev rosidl_default_runtime ament_lint_auto - ament_lint_common + + ament_cmake_uncrustify + ament_cmake_cppcheck + ament_cmake_cpplint + ament_cmake_lint_cmake ament_cmake