Skip to content

[TASK] Reusable CI/CD Pipeline for running clang-tidy on ROS2 Workspace #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
6 tasks
kluge7 opened this issue Oct 26, 2024 · 1 comment
Open
6 tasks
Labels
devops DevOps team responsible enhancement New feature or request

Comments

@kluge7
Copy link
Contributor

kluge7 commented Oct 26, 2024

Description of task

This task involves creating a reusable CI/CD pipeline using GitHub Actions to automatically run clang-tidy on a ROS 2 workspace. This pipeline will ensure that all C++ code within the workspace follows consistent quality and style standards, and it will help detect issues early.

Suggested Workflow

  1. Checkout Repository
  2. Set Up ROS 2 Environment
  3. Install colcon and Additional Dependencies
  4. Build the Workspace with colcon - This step is necessary to generate compile_commands.json files which clang-tidy uses. You might need to configure the CMakeLists.txt files in the repositories where this will be implemented
  5. Run clang-tidy
  6. Post clang-tidy Report to PR

Specifications

  • Trigger Events: The pipeline will run on workflow_call (Since its meant to be reusable)
  • clang-tidy Configuration: Include a .clang-tidy file in the repository that can be reused in other repositories
  • PR feedback: If it is possible, if clang-tidy detects any issues, these should be automatically added as a comment to the pull request the pipeline is run in.

Contacts

Code Quality

  • Every function in header files are documented (inputs/returns/exceptions)
  • The project has automated tests that cover MOST of the functions and branches in functions (pytest/gtest)
  • The code is documented on the wiki (provide link)
@kluge7 kluge7 added devops DevOps team responsible enhancement New feature or request labels Oct 26, 2024
@kluge7 kluge7 assigned kluge7 and unassigned kluge7 Oct 28, 2024
@kluge7
Copy link
Contributor Author

kluge7 commented Feb 10, 2025

My findings: The main problem is that each ROS package needs to be configured to build a command_commands.json when compiled, and it was a bit tedious to set up. Instead if it were to possible to add some sort of C/C++ linting for just static code analysis (check naming conventions, syntax errors, best practice etc.) and combine it with pre-commit hooks, then that might be worth looking into.

@kluge7 kluge7 removed their assignment Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps team responsible enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant