vortexntnu / vortex-ci

This repository holds reusable workflows for CI.
MIT License
2 stars 0 forks source link

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

Open kluge7 opened 2 weeks ago

kluge7 commented 2 weeks ago

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

Contacts

@kluge7

kluge7 commented 2 weeks ago

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