From 4b16e49646c8a265d92a20e759e4c91b37e7aff6 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:14:34 +0000 Subject: [PATCH 01/17] Test reusable workflow with composite action --- .github/actions/set-package-list/action.yml | 13 +++ .github/workflows/ci-ros-lint.yml | 23 +++++ .github/workflows/reusable-ci-ros-lint.yml | 105 ++++++++++++++++++++ .github/workflows/ros-lint.yml | 59 ----------- 4 files changed, 141 insertions(+), 59 deletions(-) create mode 100644 .github/actions/set-package-list/action.yml create mode 100644 .github/workflows/ci-ros-lint.yml create mode 100644 .github/workflows/reusable-ci-ros-lint.yml delete mode 100644 .github/workflows/ros-lint.yml diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml new file mode 100644 index 00000000..c838943a --- /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 + +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 diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml new file mode 100644 index 00000000..697923dc --- /dev/null +++ b/.github/workflows/ci-ros-lint.yml @@ -0,0 +1,23 @@ +name: ROS 2 Lint +on: + pull_request: + +env: + package-name: + control_toolbox + +jobs: + lint_rolling: + uses: ./.github/workflows/reusable-ci-ros-lint.yml + with: + ros_distro: rolling + # lint: + # uses: ./.github/workflows/reusable-ci-ros-lint.yml + # strategy: + # fail-fast: false + # matrix: + # ROS_DISTRO: [iron, humble] + # with: + # ros_distro: ${{ matrix.ROS_DISTRO }} + # # use the release specified in REP-2000 + # os_name: ubuntu-22.04 diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml new file mode 100644 index 00000000..d42e0402 --- /dev/null +++ b/.github/workflows/reusable-ci-ros-lint.yml @@ -0,0 +1,105 @@ +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] + steps: + - uses: actions/checkout@v4 + with: + path: ${{ env.path }} + - uses: ros-tooling/setup-ros@v0.7 + - name: Set package list + uses: ./.github/actions/set-package-list + 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: + # 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: 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 + # - 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: 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 + # - 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: 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 + # - uses: ros-tooling/action-ros-lint@v0.1 + # with: + # distribution: ${{ inputs.ros_distro }} + # linter: cppcheck + # arguments: "--language=c++" + # package-name: ${{ env.package_list }} diff --git a/.github/workflows/ros-lint.yml b/.github/workflows/ros-lint.yml deleted file mode 100644 index 11060a32..00000000 --- a/.github/workflows/ros-lint.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: ROS2 Lint -on: - pull_request: - -jobs: - ament_lint: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - linter: [copyright, lint_cmake] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: rolling - linter: ${{ matrix.linter }} - package-name: - control_toolbox - - ament_lint_100: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - linter: [cpplint] - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/setup-ros@v0.7 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: rolling - linter: cpplint - arguments: "--linelength=100 --filter=-whitespace/newline" - package-name: - control_toolbox - - ament_cppcheck: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - linter: [cppcheck] - env: - AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true - steps: - - uses: actions/checkout@v4 - - uses: ros-tooling/setup-ros@0.7.1 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: rolling - linter: ${{ matrix.linter }} - arguments: "--language=c++" - package-name: - control_toolbox From 9913f9612c97f5b5bcd941c6946895173a6e67b6 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:44:52 +0000 Subject: [PATCH 02/17] Mv to ros2_control_ci --- .github/actions/set-package-list/action.yml | 13 --- .github/workflows/reusable-ci-ros-lint.yml | 105 -------------------- 2 files changed, 118 deletions(-) delete mode 100644 .github/actions/set-package-list/action.yml delete mode 100644 .github/workflows/reusable-ci-ros-lint.yml diff --git a/.github/actions/set-package-list/action.yml b/.github/actions/set-package-list/action.yml deleted file mode 100644 index c838943a..00000000 --- a/.github/actions/set-package-list/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: 'Set package list' -description: 'Set the package_list environment variable' -inputs: - path: - description: 'Path to the packages' - required: true - -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 diff --git a/.github/workflows/reusable-ci-ros-lint.yml b/.github/workflows/reusable-ci-ros-lint.yml deleted file mode 100644 index d42e0402..00000000 --- a/.github/workflows/reusable-ci-ros-lint.yml +++ /dev/null @@ -1,105 +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] - steps: - - uses: actions/checkout@v4 - with: - path: ${{ env.path }} - - uses: ros-tooling/setup-ros@v0.7 - - name: Set package list - uses: ./.github/actions/set-package-list - 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: - # 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: 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 - # - 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: 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 - # - 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: 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 - # - uses: ros-tooling/action-ros-lint@v0.1 - # with: - # distribution: ${{ inputs.ros_distro }} - # linter: cppcheck - # arguments: "--language=c++" - # package-name: ${{ env.package_list }} From eb94df8082e5633fb6423d790e92d87919abc63b Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:45:08 +0000 Subject: [PATCH 03/17] Use wf from ros2_control_ci --- .github/workflows/ci-ros-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml index 697923dc..ffbb0747 100644 --- a/.github/workflows/ci-ros-lint.yml +++ b/.github/workflows/ci-ros-lint.yml @@ -8,7 +8,7 @@ env: jobs: lint_rolling: - uses: ./.github/workflows/reusable-ci-ros-lint.yml + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ci-ros-lint.yml@ci_lint with: ros_distro: rolling # lint: From c1d2992fd188fe38e362344e2f6dd1e0d1bd3091 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 13:55:29 +0000 Subject: [PATCH 04/17] Activate lint job for all distros --- .github/workflows/ci-ros-lint.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml index ffbb0747..91f7c1a2 100644 --- a/.github/workflows/ci-ros-lint.yml +++ b/.github/workflows/ci-ros-lint.yml @@ -2,22 +2,18 @@ name: ROS 2 Lint on: pull_request: -env: - package-name: - control_toolbox - jobs: lint_rolling: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ci-ros-lint.yml@ci_lint with: ros_distro: rolling - # lint: - # uses: ./.github/workflows/reusable-ci-ros-lint.yml - # strategy: - # fail-fast: false - # matrix: - # ROS_DISTRO: [iron, humble] - # with: - # ros_distro: ${{ matrix.ROS_DISTRO }} - # # use the release specified in REP-2000 - # os_name: ubuntu-22.04 + lint: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ci-ros-lint.yml@ci_lint + strategy: + fail-fast: false + matrix: + ROS_DISTRO: [iron, humble] + with: + ros_distro: ${{ matrix.ROS_DISTRO }} + # use the release specified in REP-2000 + os_name: ubuntu-22.04 From 57682353ed104689f6d8091ca7d373306c72b093 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 14:06:29 +0000 Subject: [PATCH 05/17] Test other workflows --- .github/workflows/build-binary.yml | 2 +- .github/workflows/build-source.yml | 2 +- .github/workflows/debian-build.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-binary.yml b/.github/workflows/build-binary.yml index 657a1799..ffdceed5 100644 --- a/.github/workflows/build-binary.yml +++ b/.github/workflows/build-binary.yml @@ -14,7 +14,7 @@ on: jobs: binary: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@ci_lint strategy: fail-fast: false matrix: diff --git a/.github/workflows/build-source.yml b/.github/workflows/build-source.yml index 662a3338..63858e4e 100644 --- a/.github/workflows/build-source.yml +++ b/.github/workflows/build-source.yml @@ -10,7 +10,7 @@ on: jobs: source_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@master + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@ci_lint strategy: fail-fast: false matrix: diff --git a/.github/workflows/debian-build.yml b/.github/workflows/debian-build.yml index ff3e5f66..4450b14a 100644 --- a/.github/workflows/debian-build.yml +++ b/.github/workflows/debian-build.yml @@ -11,7 +11,7 @@ on: jobs: debian_source_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@master + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@ci_lint strategy: fail-fast: false matrix: From 0a670d94ccf799120cc22ac2f49cbd48abc63928 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 14:08:17 +0000 Subject: [PATCH 06/17] Test rhel workflow too --- .github/workflows/rhel-semi-binary-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rhel-semi-binary-build.yml b/.github/workflows/rhel-semi-binary-build.yml index ce84552f..d16a59e2 100644 --- a/.github/workflows/rhel-semi-binary-build.yml +++ b/.github/workflows/rhel-semi-binary-build.yml @@ -11,7 +11,7 @@ on: jobs: rhel_semi_binary_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@ci_lint strategy: fail-fast: false matrix: From 24894d1dffbdbc1039d7349e7655a522bac79086 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 22:00:13 +0000 Subject: [PATCH 07/17] Update pre-commit config --- .github/workflows/ci-format.yml | 21 --------------------- .github/workflows/ci-pre-commit.yml | 9 +++++++++ .pre-commit-config.yaml | 5 ----- 3 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/ci-format.yml create mode 100644 .github/workflows/ci-pre-commit.yml diff --git a/.github/workflows/ci-format.yml b/.github/workflows/ci-format.yml deleted file mode 100644 index 88fad33b..00000000 --- a/.github/workflows/ci-format.yml +++ /dev/null @@ -1,21 +0,0 @@ -# This is a format job. Pre-commit has a first-party GitHub action, so we use -# that: https://github.com/pre-commit/action - -name: Format - -on: - workflow_dispatch: - pull_request: - -jobs: - pre-commit: - name: Format - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - name: Install clang-format-14 - run: sudo apt-get install clang-format-14 cppcheck - - uses: pre-commit/action@v3.0.1 - with: - extra_args: --all-files --hook-stage manual diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml new file mode 100644 index 00000000..0d75b417 --- /dev/null +++ b/.github/workflows/ci-pre-commit.yml @@ -0,0 +1,9 @@ +name: Format + +on: + workflow_dispatch: + pull_request: + +jobs: + pre-commit: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@ci_format diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e0e111c..656175b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -76,18 +76,15 @@ repos: - id: ament_cppcheck name: ament_cppcheck description: Static code analysis of C/C++ files. - stages: [commit] entry: ament_cppcheck language: system files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ - # Maybe use https://github.com/cpplint/cpplint instead - repo: local hooks: - id: ament_cpplint name: ament_cpplint description: Static code analysis of C/C++ files. - stages: [commit] entry: ament_cpplint language: system files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ @@ -99,7 +96,6 @@ repos: - id: ament_lint_cmake name: ament_lint_cmake description: Check format of CMakeLists.txt files. - stages: [commit] entry: ament_lint_cmake language: system files: CMakeLists\.txt$ @@ -110,7 +106,6 @@ repos: - id: ament_copyright name: ament_copyright description: Check if copyright notice is available in all files. - stages: [commit] entry: ament_copyright language: system From 0a557c250e312de45f17d3bc41578ee7abd4f4e6 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 22:00:29 +0000 Subject: [PATCH 08/17] Remove unnecessary lint job --- .github/workflows/ci-ros-lint.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/ci-ros-lint.yml diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml deleted file mode 100644 index 91f7c1a2..00000000 --- a/.github/workflows/ci-ros-lint.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: ROS 2 Lint -on: - pull_request: - -jobs: - lint_rolling: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ci-ros-lint.yml@ci_lint - with: - ros_distro: rolling - lint: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ci-ros-lint.yml@ci_lint - strategy: - fail-fast: false - matrix: - ROS_DISTRO: [iron, humble] - with: - ros_distro: ${{ matrix.ROS_DISTRO }} - # use the release specified in REP-2000 - os_name: ubuntu-22.04 From 9bec3db74c87cf8dd11ba5bbc87f01b768380d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sun, 18 Feb 2024 23:11:23 +0100 Subject: [PATCH 09/17] Switch to master branch of ros2_control_ci --- .github/workflows/build-binary.yml | 2 +- .github/workflows/build-source.yml | 2 +- .github/workflows/ci-pre-commit.yml | 2 +- .github/workflows/debian-build.yml | 2 +- .github/workflows/rhel-semi-binary-build.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-binary.yml b/.github/workflows/build-binary.yml index ffdceed5..657a1799 100644 --- a/.github/workflows/build-binary.yml +++ b/.github/workflows/build-binary.yml @@ -14,7 +14,7 @@ on: jobs: binary: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@ci_lint + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: fail-fast: false matrix: diff --git a/.github/workflows/build-source.yml b/.github/workflows/build-source.yml index 63858e4e..662a3338 100644 --- a/.github/workflows/build-source.yml +++ b/.github/workflows/build-source.yml @@ -10,7 +10,7 @@ on: jobs: source_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@ci_lint + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-ros-tooling-source-build.yml@master strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index 0d75b417..f3edd683 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -6,4 +6,4 @@ on: jobs: pre-commit: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@ci_format + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master diff --git a/.github/workflows/debian-build.yml b/.github/workflows/debian-build.yml index 4450b14a..ff3e5f66 100644 --- a/.github/workflows/debian-build.yml +++ b/.github/workflows/debian-build.yml @@ -11,7 +11,7 @@ on: jobs: debian_source_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@ci_lint + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-debian-build.yml@master strategy: fail-fast: false matrix: diff --git a/.github/workflows/rhel-semi-binary-build.yml b/.github/workflows/rhel-semi-binary-build.yml index d16a59e2..ce84552f 100644 --- a/.github/workflows/rhel-semi-binary-build.yml +++ b/.github/workflows/rhel-semi-binary-build.yml @@ -11,7 +11,7 @@ on: jobs: rhel_semi_binary_build: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@ci_lint + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master strategy: fail-fast: false matrix: From a0b968b8ef40a9328a91d44ff9904f03e4d5c563 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 18 Feb 2024 22:52:33 +0000 Subject: [PATCH 10/17] Give new ros_distro input --- .github/workflows/ci-pre-commit.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index f3edd683..526ac990 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -6,4 +6,10 @@ on: jobs: pre-commit: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@ci_format + strategy: + fail-fast: false + matrix: + ROS_DISTRO: [rolling, iron, humble] + with: + ros_distro: ${{ matrix.ROS_DISTRO }} From c6164c2be96d598a2ee8944f0a46444d1216effc Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 19 Feb 2024 00:41:14 +0000 Subject: [PATCH 11/17] Update pre-commit config and fix codespell --- .pre-commit-config.yaml | 40 +++++++++++++++++++++++----------------- src/sine_sweep.cpp | 2 +- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 656175b1..ec3cbbf3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-ast @@ -36,17 +36,11 @@ repos: # Python hooks - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.1 hooks: - id: pyupgrade args: [--py36-plus] - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - args: ["--line-length=99"] - # PyDocStyle - repo: https://github.com/PyCQA/pydocstyle rev: 6.3.0 @@ -54,21 +48,23 @@ repos: - id: pydocstyle args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"] + - repo: https://github.com/psf/black + rev: 24.2.0 + hooks: + - id: black + args: ["--line-length=99"] + - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 args: ["--extend-ignore=E501"] # CPP hooks - - repo: local + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v17.0.6 hooks: - id: clang-format - name: clang-format - description: Format files with ClangFormat. - entry: clang-format-14 - language: system - files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$ args: ['-fallback-style=none', '-i'] - repo: local @@ -76,7 +72,7 @@ repos: - id: ament_cppcheck name: ament_cppcheck description: Static code analysis of C/C++ files. - entry: ament_cppcheck + entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck language: system files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ @@ -128,8 +124,18 @@ repos: # Spellcheck in comments and docs # skipping of *.svg files is not working... - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.6 hooks: - id: codespell args: ['--write-changes'] exclude: CHANGELOG\.rst|\.(svg|pyc)$ + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + args: ["--verbose"] + - id: check-github-actions + args: ["--verbose"] + - id: check-dependabot + args: ["--verbose"] diff --git a/src/sine_sweep.cpp b/src/sine_sweep.cpp index f606907a..eb000f36 100644 --- a/src/sine_sweep.cpp +++ b/src/sine_sweep.cpp @@ -60,7 +60,7 @@ bool SineSweep::init(double start_freq, double end_freq, double duration, double amplitude_ = amplitude; duration_ = rclcpp::Duration::from_seconds(duration); - // calculate the angular fequencies + // calculate the angular frequencies start_angular_freq_ = 2 * M_PI * start_freq; end_angular_freq_ = 2 * M_PI * end_freq; From c6ec19afc90e56c867dec4c91d47970d6a428c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Wed, 21 Feb 2024 21:54:31 +0100 Subject: [PATCH 12/17] Switch to master branch --- .github/workflows/ci-pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index 526ac990..1eefe491 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -6,7 +6,7 @@ on: jobs: pre-commit: - uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@ci_format + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master strategy: fail-fast: false matrix: From 39cf7d934b94cff5fe4c64ebc15c13d7a4d4487c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Wed, 21 Feb 2024 22:24:56 +0100 Subject: [PATCH 13/17] Update .github/workflows/ci-pre-commit.yml Co-authored-by: Felix Exner (fexner) --- .github/workflows/ci-pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index 1eefe491..676f1f46 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -1,4 +1,4 @@ -name: Format +name: Pre-Commit on: workflow_dispatch: From 3d7b126de9378d7d38ada2ab0a68b11fc2e7b30c Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Feb 2024 07:35:31 +0000 Subject: [PATCH 14/17] Add update-pre-commit wf --- .github/workflows/update-pre-commit.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/update-pre-commit.yml diff --git a/.github/workflows/update-pre-commit.yml b/.github/workflows/update-pre-commit.yml new file mode 100644 index 00000000..8b9545df --- /dev/null +++ b/.github/workflows/update-pre-commit.yml @@ -0,0 +1,12 @@ +name: Auto Update pre-commit +# Update pre-commit config and create PR if changes are detected +# author: Christoph Fröhlich + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # Run every Sunday at midnight + +jobs: + auto_update_and_create_pr: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-update-pre-commit.yml@master From 6e08a844e53416903aeace2cefb9ef5ec7eb29fd Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Feb 2024 07:45:17 +0000 Subject: [PATCH 15/17] Add apache license badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0dd32485..8af62c7e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ control_toolbox =========== +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![codecov](https://codecov.io/gh/ros-controls/control_toolbox/graph/badge.svg?token=0o4dFzADHj)](https://codecov.io/gh/ros-controls/control_toolbox) See the documentation of [ros2_control](http://control.ros.org) and release infos on [index.ros.org](http://index.ros.org/p/control_toolbox). From f567ecae1f71d9e53784cd2f92c1d49e58f33f57 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Feb 2024 08:07:03 +0000 Subject: [PATCH 16/17] Fix license badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8af62c7e..846c4a7e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ control_toolbox =========== -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![codecov](https://codecov.io/gh/ros-controls/control_toolbox/graph/badge.svg?token=0o4dFzADHj)](https://codecov.io/gh/ros-controls/control_toolbox) See the documentation of [ros2_control](http://control.ros.org) and release infos on [index.ros.org](http://index.ros.org/p/control_toolbox). From b297e2c83ad4bdaa5e25542730bee0dac99e159b Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Feb 2024 22:40:41 +0000 Subject: [PATCH 17/17] Remove unnecessary link --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b741ee5..dcace4f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,4 +58,3 @@ be under the 3-Clause BSD License, as dictated by that [issues]: https://github.com/ros-controls/control_toolbox/issues [closed-issues]: https://github.com/ros-controls/control_toolbox/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20 [help-wanted]: https://github.com/ros-controls/control_toolbox/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22 -[license]: https://opensource.org/licenses/BSD-3-Clause