From 9d4a8e856137d1bf5f4ee5bb8aa871558d3f25b8 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:42:47 +0000 Subject: [PATCH 1/9] Add composite action for set-package-list --- .github/actions/set-package-list/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/actions/set-package-list/action.yml diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml new file mode 100644 index 0000000..614bc29 --- /dev/null +++ b/.github/actions/set-package-list/action.yml @@ -0,0 +1,13 @@ +name: 'Set package list' +description: 'Set the package_list environment variable' +inputs: + path: + description: 'Path to the packages' + required: true +# has to be run after ROS 2 setup, i.e., by ros-tooling/setup-ros +runs: + using: 'composite' + steps: + - run: | + echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV + shell: bash From 3384acb0272b363e76a748693baf051138dd64c7 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:43:30 +0000 Subject: [PATCH 2/9] Add reusable wf for ros-lint --- .github/workflows/reusable-ci-ros-lint.yml | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/reusable-ci-ros-lint.yml diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml new file mode 100644 index 0000000..cb92b5c --- /dev/null +++ b/.github/workflows/reusable-ci-ros-lint.yml @@ -0,0 +1,83 @@ +name: Reusable ROS 2 Lint workflow +# Reusable action to simplify dealing with ros-linting +# author: Christoph Froehlich + +on: + workflow_call: + inputs: + ros_distro: + description: 'ROS2 distribution name' + required: true + type: string + os_name: + description: 'On which OS to run the linter' + required: false + default: 'ubuntu-latest' + type: string + +env: + # this will be src/{repo-owner}/{repo-name} + path: src/${{ github.repository }} + +jobs: + ament_lint: + name: ament_${{ matrix.linter }} + runs-on: ${{ inputs.os_name }} + strategy: + fail-fast: false + matrix: + linter: [copyright, lint_cmake] + steps: + - uses: actions/checkout@v4 + with: + path: ${{ env.path }} + - uses: ros-tooling/setup-ros@v0.7 + - name: Set package list + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} + - uses: ros-tooling/action-ros-lint@v0.1 + with: + distribution: ${{ inputs.ros_distro }} + linter: ${{ matrix.linter }} + package-name: ${{ env.package_list }} + + ament_lint_100: + name: ament_cpplint + runs-on: ${{ inputs.os_name }} + steps: + - uses: actions/checkout@v4 + with: + path: ${{ env.path }} + - uses: ros-tooling/setup-ros@v0.7 + - name: Set package list + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} + - uses: ros-tooling/action-ros-lint@v0.1 + with: + distribution: ${{ inputs.ros_distro }} + linter: cpplint + arguments: "--linelength=100 --filter=-whitespace/newline" + package-name: ${{ env.package_list }} + + ament_cppcheck: + name: ament_cppcheck + runs-on: ${{ inputs.os_name }} + env: + AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true + steps: + - uses: actions/checkout@v4 + with: + path: ${{ env.path }} + - uses: ros-tooling/setup-ros@0.7.1 + - name: Set package list + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} + - uses: ros-tooling/action-ros-lint@v0.1 + with: + distribution: ${{ inputs.ros_distro }} + linter: cppcheck + arguments: "--language=c++" + package-name: ${{ env.package_list }} From ba882b9c9d7564bec6cb7c81d221391c7e09eacc Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:54:57 +0000 Subject: [PATCH 3/9] Use GITHUB_OUTPUT instead of environment variable --- .github/actions/set-package-list/action.yml | 16 +++++++++++----- .github/workflows/reusable-ci-ros-lint.yml | 12 ++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml index 614bc29..46b0600 100644 --- a/.github/actions/set-package-list/action.yml +++ b/.github/actions/set-package-list/action.yml @@ -1,13 +1,19 @@ -name: 'Set package list' -description: 'Set the package_list environment variable' +name: 'Get package list' +# has to be run after ROS 2 setup, i.e., by ros-tooling/setup-ros +description: 'Get a list of packages in the given path' inputs: path: description: 'Path to the packages' required: true -# has to be run after ROS 2 setup, i.e., by ros-tooling/setup-ros +outputs: + package_list: + description: "A white-space separated list of packages" + value: ${{ steps.colcon.outputs.package_list }} + runs: using: 'composite' steps: - - run: | - echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV + - id: colcon + run: | + echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml index cb92b5c..aa8b11e 100644 --- a/.github/workflows/reusable-ci-ros-lint.yml +++ b/.github/workflows/reusable-ci-ros-lint.yml @@ -32,7 +32,7 @@ jobs: with: path: ${{ env.path }} - uses: ros-tooling/setup-ros@v0.7 - - name: Set package list + - id: package_list_action uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: path: ${{ env.path }} @@ -40,7 +40,7 @@ jobs: with: distribution: ${{ inputs.ros_distro }} linter: ${{ matrix.linter }} - package-name: ${{ env.package_list }} + package-name: ${{ steps.package_list_action.outputs.package_list }} ament_lint_100: name: ament_cpplint @@ -50,7 +50,7 @@ jobs: with: path: ${{ env.path }} - uses: ros-tooling/setup-ros@v0.7 - - name: Set package list + - id: package_list_action uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: path: ${{ env.path }} @@ -59,7 +59,7 @@ jobs: distribution: ${{ inputs.ros_distro }} linter: cpplint arguments: "--linelength=100 --filter=-whitespace/newline" - package-name: ${{ env.package_list }} + package-name: ${{ steps.package_list_action.outputs.package_list }} ament_cppcheck: name: ament_cppcheck @@ -71,7 +71,7 @@ jobs: with: path: ${{ env.path }} - uses: ros-tooling/setup-ros@0.7.1 - - name: Set package list + - id: package_list_action uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint with: path: ${{ env.path }} @@ -80,4 +80,4 @@ jobs: distribution: ${{ inputs.ros_distro }} linter: cppcheck arguments: "--language=c++" - package-name: ${{ env.package_list }} + package-name: ${{ steps.package_list_action.outputs.package_list }} From 8db50fb3484510184acc029c194b5cb3f44766b2 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 14:05:25 +0000 Subject: [PATCH 4/9] Use composite action also with other workflows --- .github/actions/set-package-list/action.yml | 5 ++++ .github/workflows/reusable-debian-build.yml | 12 ++++----- .../workflows/reusable-rhel-binary-build.yml | 12 ++++----- .../reusable-ros-tooling-source-build.yml | 25 +++++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml index 46b0600..5129379 100644 --- a/.github/actions/set-package-list/action.yml +++ b/.github/actions/set-package-list/action.yml @@ -9,6 +9,10 @@ outputs: package_list: description: "A white-space separated list of packages" value: ${{ steps.colcon.outputs.package_list }} + repo_name: + description: "A white-space separated list of packages" + value: ${{ steps.colcon.outputs.REPO_NAME }} + runs: using: 'composite' @@ -16,4 +20,5 @@ runs: - id: colcon run: | echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_OUTPUT + echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/reusable-debian-build.yml b/.github/workflows/reusable-debian-build.yml index fe6b7dd..97e2a4e 100644 --- a/.github/workflows/reusable-debian-build.yml +++ b/.github/workflows/reusable-debian-build.yml @@ -57,19 +57,19 @@ jobs: if [[ -n "${{ inputs.upstream_workspace }}" ]]; then vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} fi - - name: Get list of packages - # we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time - run: | - echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV + - id: package_list_action + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} - name: Build workspace shell: bash run: | source /opt/ros2_ws/install/setup.bash - colcon build --packages-up-to ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} + colcon build --packages-up-to ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }} - name: Test workspace shell: bash continue-on-error: true run: | source /opt/ros2_ws/install/setup.bash - colcon test --packages-select ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} + colcon test --packages-select ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} colcon test-result --verbose diff --git a/.github/workflows/reusable-rhel-binary-build.yml b/.github/workflows/reusable-rhel-binary-build.yml index c920bbc..bc9234b 100644 --- a/.github/workflows/reusable-rhel-binary-build.yml +++ b/.github/workflows/reusable-rhel-binary-build.yml @@ -63,22 +63,22 @@ jobs: fi rosdep update rosdep install -iyr --from-path src || true - - name: Get list of packages - # we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time - run: | - echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV + - id: package_list_action + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} - name: Build workspace shell: bash # source also underlay workspace with generate_parameter_library on rhel9 run: | source /opt/ros/${{ inputs.ros_distro }}/setup.bash source /opt/ros2_ws/install/local_setup.bash - colcon build --packages-up-to ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} + colcon build --packages-up-to ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }} - name: Test workspace shell: bash continue-on-error: true run: | source /opt/ros/${{ inputs.ros_distro }}/setup.bash source /opt/ros2_ws/install/local_setup.bash - colcon test --packages-select ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} + colcon test --packages-select ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} colcon test-result --verbose diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml index acdc764..bec3120 100644 --- a/.github/workflows/reusable-ros-tooling-source-build.yml +++ b/.github/workflows/reusable-ros-tooling-source-build.yml @@ -18,11 +18,16 @@ on: default: 'master' required: false type: string + os_name: + description: 'On which OS to run the linter' + required: false + default: 'ubuntu-latest' + type: string jobs: reusable_ros_tooling_source_build: - name: ${{ inputs.ros_distro }} ubuntu-22.04 - runs-on: ubuntu-22.04 + name: ${{ inputs.ros_distro }} ${{ inputs.os_name }} + runs-on: ${{ inputs.os_name }} env: # this will be src/{repo-owner}/{repo-name} path: src/${{ github.repository }} @@ -36,22 +41,20 @@ jobs: with: ref: ${{ inputs.ref }} path: ${{ env.path }} - - name: Get list of packages - # we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time - run: | - echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV - echo "package_list=$(colcon list --paths ${{ env.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ env.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_ENV - echo "repo ${{ env.REPO_NAME}} has packages: ${{ env.package_list }}" + - id: package_list_action + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + with: + path: ${{ env.path }} - uses: ros-tooling/action-ros-ci@0.3.6 with: target-ros2-distro: ${{ inputs.ros_distro }} ref: ${{ inputs.ref }} - package-name: ${{ env.package_list }} + package-name: ${{ steps.package_list_action.outputs.package_list }} vcs-repo-file-url: | https://raw.githubusercontent.com/ros2/ros2/${{ inputs.ros2_repo_branch }}/ros2.repos - ${{ env.path }}/${{ env.REPO_NAME}}.${{ inputs.ros_distro }}.repos + ${{ env.path }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.ros_distro }}.repos colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - uses: actions/upload-artifact@v4.3.1 with: - name: colcon-logs-ubuntu-22.04-${{ inputs.ros_distro }} + name: colcon-logs-${{ inputs.os_name }}-${{ inputs.ros_distro }} path: ros_ws/log From 50e5a9d1984077c0c0936946e48f8e46728483fb Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 14:17:30 +0000 Subject: [PATCH 5/9] Switch to master branch --- .github/workflows/reusable-ci-ros-lint.yml | 6 +++--- .github/workflows/reusable-debian-build.yml | 2 +- .github/workflows/reusable-rhel-binary-build.yml | 2 +- .github/workflows/reusable-ros-tooling-source-build.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml index aa8b11e..7c391ba 100644 --- a/.github/workflows/reusable-ci-ros-lint.yml +++ b/.github/workflows/reusable-ci-ros-lint.yml @@ -33,7 +33,7 @@ jobs: path: ${{ env.path }} - uses: ros-tooling/setup-ros@v0.7 - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - uses: ros-tooling/action-ros-lint@v0.1 @@ -51,7 +51,7 @@ jobs: path: ${{ env.path }} - uses: ros-tooling/setup-ros@v0.7 - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - uses: ros-tooling/action-ros-lint@v0.1 @@ -72,7 +72,7 @@ jobs: path: ${{ env.path }} - uses: ros-tooling/setup-ros@0.7.1 - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - uses: ros-tooling/action-ros-lint@v0.1 diff --git a/.github/workflows/reusable-debian-build.yml b/.github/workflows/reusable-debian-build.yml index 97e2a4e..bf69334 100644 --- a/.github/workflows/reusable-debian-build.yml +++ b/.github/workflows/reusable-debian-build.yml @@ -58,7 +58,7 @@ jobs: vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} fi - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - name: Build workspace diff --git a/.github/workflows/reusable-rhel-binary-build.yml b/.github/workflows/reusable-rhel-binary-build.yml index bc9234b..3c73f62 100644 --- a/.github/workflows/reusable-rhel-binary-build.yml +++ b/.github/workflows/reusable-rhel-binary-build.yml @@ -64,7 +64,7 @@ jobs: rosdep update rosdep install -iyr --from-path src || true - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - name: Build workspace diff --git a/.github/workflows/reusable-ros-tooling-source-build.yml b/.github/workflows/reusable-ros-tooling-source-build.yml index bec3120..86a2d2c 100644 --- a/.github/workflows/reusable-ros-tooling-source-build.yml +++ b/.github/workflows/reusable-ros-tooling-source-build.yml @@ -42,7 +42,7 @@ jobs: ref: ${{ inputs.ref }} path: ${{ env.path }} - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@ci_lint + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master with: path: ${{ env.path }} - uses: ros-tooling/action-ros-ci@0.3.6 From b2ad3ed094f13c779a9b6776b43f8304bd55506e Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 14:19:20 +0000 Subject: [PATCH 6/9] Fix comment --- .github/actions/set-package-list/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml index 5129379..6a1df02 100644 --- a/.github/actions/set-package-list/action.yml +++ b/.github/actions/set-package-list/action.yml @@ -10,7 +10,7 @@ outputs: description: "A white-space separated list of packages" value: ${{ steps.colcon.outputs.package_list }} repo_name: - description: "A white-space separated list of packages" + description: "The name of the repo, last part of ${{ github.repository }}" value: ${{ steps.colcon.outputs.REPO_NAME }} From d8fcfb8c0b579de4f915169ded86a3b293695fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sun, 18 Feb 2024 19:23:44 +0100 Subject: [PATCH 7/9] Update .github/actions/set-package-list/action.yml --- .github/actions/set-package-list/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml index 6a1df02..8bea5e9 100644 --- a/.github/actions/set-package-list/action.yml +++ b/.github/actions/set-package-list/action.yml @@ -10,7 +10,7 @@ outputs: description: "A white-space separated list of packages" value: ${{ steps.colcon.outputs.package_list }} repo_name: - description: "The name of the repo, last part of ${{ github.repository }}" + description: "The name of the repo, last part of github.repository" value: ${{ steps.colcon.outputs.REPO_NAME }} From 23545a6474879400fac8dac255b22dc725d0cd63 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 19:26:05 +0000 Subject: [PATCH 8/9] Add console output to action --- .github/actions/set-package-list/action.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml index 8bea5e9..6f5f58b 100644 --- a/.github/actions/set-package-list/action.yml +++ b/.github/actions/set-package-list/action.yml @@ -3,7 +3,7 @@ name: 'Get package list' description: 'Get a list of packages in the given path' inputs: path: - description: 'Path to the packages' + description: 'Path to the repository after checkout' required: true outputs: package_list: @@ -11,7 +11,7 @@ outputs: value: ${{ steps.colcon.outputs.package_list }} repo_name: description: "The name of the repo, last part of github.repository" - value: ${{ steps.colcon.outputs.REPO_NAME }} + value: ${{ steps.split_repo.outputs.repo_name }} runs: @@ -20,5 +20,11 @@ runs: - id: colcon run: | echo "package_list=$(colcon list --paths ${{ inputs.path }} --names-only | tr '\n' ' ') $(colcon list --paths ${{ inputs.path }}/* --names-only | tr '\n' ' ')" >> $GITHUB_OUTPUT - echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT + shell: bash + - id: split_repo + run: | + echo "repo_name=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT + shell: bash + - run: | + echo "repo ${{ steps.split_repo.outputs.repo_name }} contains the packages: ${{ steps.colcon.outputs.package_list }}" shell: bash From c330ea37bb4cdf7c403bea6c05c0e072203fdb1d Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 21:52:47 +0000 Subject: [PATCH 9/9] Remove ros-lint --- .github/workflows/reusable-ci-ros-lint.yml | 83 ---------------------- 1 file changed, 83 deletions(-) delete mode 100644 .github/workflows/reusable-ci-ros-lint.yml diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml deleted file mode 100644 index 7c391ba..0000000 --- a/.github/workflows/reusable-ci-ros-lint.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Reusable ROS 2 Lint workflow -# Reusable action to simplify dealing with ros-linting -# author: Christoph Froehlich - -on: - workflow_call: - inputs: - ros_distro: - description: 'ROS2 distribution name' - required: true - type: string - os_name: - description: 'On which OS to run the linter' - required: false - default: 'ubuntu-latest' - type: string - -env: - # this will be src/{repo-owner}/{repo-name} - path: src/${{ github.repository }} - -jobs: - ament_lint: - name: ament_${{ matrix.linter }} - runs-on: ${{ inputs.os_name }} - strategy: - fail-fast: false - matrix: - linter: [copyright, lint_cmake] - steps: - - uses: actions/checkout@v4 - with: - path: ${{ env.path }} - - uses: ros-tooling/setup-ros@v0.7 - - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master - with: - path: ${{ env.path }} - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: ${{ inputs.ros_distro }} - linter: ${{ matrix.linter }} - package-name: ${{ steps.package_list_action.outputs.package_list }} - - ament_lint_100: - name: ament_cpplint - runs-on: ${{ inputs.os_name }} - steps: - - uses: actions/checkout@v4 - with: - path: ${{ env.path }} - - uses: ros-tooling/setup-ros@v0.7 - - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master - with: - path: ${{ env.path }} - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: ${{ inputs.ros_distro }} - linter: cpplint - arguments: "--linelength=100 --filter=-whitespace/newline" - package-name: ${{ steps.package_list_action.outputs.package_list }} - - ament_cppcheck: - name: ament_cppcheck - runs-on: ${{ inputs.os_name }} - env: - AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true - steps: - - uses: actions/checkout@v4 - with: - path: ${{ env.path }} - - uses: ros-tooling/setup-ros@0.7.1 - - id: package_list_action - uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master - with: - path: ${{ env.path }} - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: ${{ inputs.ros_distro }} - linter: cppcheck - arguments: "--language=c++" - package-name: ${{ steps.package_list_action.outputs.package_list }}