Skip to content
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

[TASK] Reusable CI/CD Pipeline for running clang-tidy for Embedded #26

Open
3 tasks
kluge7 opened this issue Nov 3, 2024 · 1 comment
Open
3 tasks
Assignees
Labels
devops DevOps team responsible embedded Embedded team responsible enhancement New feature or request

Comments

@kluge7
Copy link
Contributor

kluge7 commented Nov 3, 2024

Description of task

This task involves creating a reusable CI/CD pipeline using GitHub Actions to automatically run clang-tidy for our embedded repositories. 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. Generate compile_commands.json file
  3. Run clang-tidy
  4. 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

@kluge7

@kluge7 kluge7 added devops DevOps team responsible embedded Embedded team responsible enhancement New feature or request labels Nov 3, 2024
@kluge7
Copy link
Contributor Author

kluge7 commented Nov 3, 2024

Here's an outline of how I envision the pipeline working:

  1. Check out the code: Use the actions/checkout step to pull the repository code into the workflow.
  2. Set up CMake/Make: Install CMake/Make and any necessary dependencies to prepare for building the project.
  3. **Generate compile_commands.json: You need to use CMake (or make) to generate the compile_commands.jsonfile, which clang-tidy requires to understand the compilation process
  4. **Run clang-tidy: Run clang-tidyon the C source files to analyze the code for style and quality issues. NB: It needs to use the .clang-tidy config file here!
  5. Post comments: I imagine this pipeline will be used in pull-requests, so if it is possible, i would like to implement this: https://github.com/marketplace/actions/clang-tidy-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps team responsible embedded Embedded team responsible enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants