From 2449cbf6344711981bc8f89a2db5b1544256bef1 Mon Sep 17 00:00:00 2001 From: Wonho Yun Date: Tue, 18 Feb 2025 17:00:22 +0900 Subject: [PATCH] Added CI and Lint Signed-off-by: Wonho Yun --- .github/workflows/ros-ci.yaml | 57 ++++++++++++++++------------------ .github/workflows/ros-lint.yml | 32 +++++++++++++++++++ 2 files changed, 58 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/ros-lint.yml diff --git a/.github/workflows/ros-ci.yaml b/.github/workflows/ros-ci.yaml index 5456138..92a7bb3 100644 --- a/.github/workflows/ros-ci.yaml +++ b/.github/workflows/ros-ci.yaml @@ -1,62 +1,57 @@ -name: humble-devel +# The name of the workflow +name: CI -# Controls when the action will run. Triggers the workflow on push or pull request +# Specifies the events that trigger the workflow on: push: - branches: [ humble-devel ] + branches: [ main, humble ] pull_request: - branches: [ humble-devel ] + branches: [ main, humble ] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel +# Defines a set of jobs to be run as part of the workflow jobs: - humble-devel: - runs-on: ubuntu-latest + # The name of the job + ROS_CI: + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: ros_distribution: - # - dashing - # - foxy - # - galactic - humble + # - jazzy # - rolling include: - # # Dashing Diademata (May 2019 - May 2021) - # - docker_image: ubuntu:bionic - # ros_distribution: dashing - # ros_version: 2 - # # Foxy Fitzroy (June 2020 - May 2023) - # - docker_image: ubuntu:focal - # ros_distribution: foxy - # ros_version: 2 - # # Galactic Geochelone (May 2021) - # - docker_image: ubuntu:focal - # ros_distribution: galactic - # ros_version: 2 - # Humble Hawksbill (May 2027) + # ROS 2 Humble Hawksbill - docker_image: ubuntu:jammy ros_distribution: humble ros_version: 2 - # # Rolling - # - docker_image: ubuntu:jammy + # ROS 2 Jazzy Jalisco + # - docker_image: ubuntu:noble + # ros_distribution: jazzy + # ros_version: 2 + # ROS 2 Rolling Ridley + # - docker_image: ubuntu:noble # ros_distribution: rolling # ros_version: 2 container: image: ${{ matrix.docker_image }} steps: - - name: Setup directories + - name: Setup workspace run: mkdir -p ros_ws/src - - name: checkout - uses: actions/checkout@v3 + + - name: Checkout code + uses: actions/checkout@v4 with: path: ros_ws/src + - name: Setup ROS environment - uses: ros-tooling/setup-ros@0.3.3 + uses: ros-tooling/setup-ros@v0.7 with: required-ros-distributions: ${{ matrix.ros_distribution }} + - name: Build and Test - uses: ros-tooling/action-ros-ci@0.2.5 + uses: ros-tooling/action-ros-ci@v0.3 with: - package-name: turtlebot3_msgs target-ros2-distro: ${{ matrix.ros_distribution }} vcs-repo-file-url: "" + package-name: turtlebot3_msgs diff --git a/.github/workflows/ros-lint.yml b/.github/workflows/ros-lint.yml new file mode 100644 index 0000000..c6eb5be --- /dev/null +++ b/.github/workflows/ros-lint.yml @@ -0,0 +1,32 @@ +# The name of the workflow +name: Lint + +# Specifies the events that trigger the workflow +on: + pull_request: + +# Defines a set of jobs to be run as part of the workflow +jobs: + ament_lint: + runs-on: ubuntu-latest + container: + image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest + strategy: + fail-fast: false + matrix: + linter: [cppcheck, cpplint, uncrustify, flake8, pep257, lint_cmake, xmllint, copyright] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup ROS environment + uses: ros-tooling/setup-ros@v0.7 + + - name: Run Linter + env: + AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: 1 + uses: ros-tooling/action-ros-lint@master + with: + linter: ${{ matrix.linter }} + distribution: rolling + package-name: "*"