Skip to content

Limit cppcheck scan to changed modules on CI#2346

Merged
Neverlord merged 1 commit intomainfrom
gh-2294-speedup-cppcheck-ci
Apr 13, 2026
Merged

Limit cppcheck scan to changed modules on CI#2346
Neverlord merged 1 commit intomainfrom
gh-2294-speedup-cppcheck-ci

Conversation

@Neverlord
Copy link
Copy Markdown
Member

@Neverlord Neverlord commented Apr 10, 2026

A full cppcheck run takes about 20 Minutes on CI. However, few PRs touch all the components in CAF. So instead of doing a full scan each time, we look at the list of modified files and only select the relevant directories for cppcheck.

When running the pipeline for main, we still always do a full scan to catch regressions after merge commits early.

Closes #2294.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR speeds up CI cppcheck by scanning only the modules touched by a PR (based on git diff), while keeping a full scan for main to catch post-merge regressions.

Changes:

  • Extend scripts/cppcheck.sh to optionally filter compile_commands.json by a set of directories.
  • Update quality-checks.yml to run a full scan on main and a scoped scan on non-main refs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/cppcheck.sh Adds optional directory-based filtering of the compile database before running cppcheck; also changes enabled check categories.
.github/workflows/quality-checks.yml Splits cppcheck job into full scan on main vs. scoped scan for other refs using git diff.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/quality-checks.yml Outdated
Comment thread .github/workflows/quality-checks.yml Outdated
Comment thread scripts/cppcheck.sh
Comment thread scripts/cppcheck.sh
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.82%. Comparing base (0633b51) to head (46267ed).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2346      +/-   ##
==========================================
- Coverage   72.85%   72.82%   -0.04%     
==========================================
  Files         632      632              
  Lines       30834    30832       -2     
  Branches     3319     3319              
==========================================
- Hits        22464    22453      -11     
- Misses       6474     6480       +6     
- Partials     1896     1899       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Neverlord Neverlord force-pushed the gh-2294-speedup-cppcheck-ci branch from f23dc93 to 46267ed Compare April 13, 2026 08:48
@Neverlord Neverlord marked this pull request as ready for review April 13, 2026 08:51
@Neverlord Neverlord requested a review from riemass April 13, 2026 08:51
@riemass
Copy link
Copy Markdown
Member

riemass commented Apr 13, 2026

Our modules are dependent on one another - so I guess we're on the same page here - running everything after merging on main, and a good-enough scan on the PR.
Also, we control the CI, I guess nobody is gonna do jq injections, but good you sanitized the input 😄.

@Neverlord Neverlord merged commit 551937c into main Apr 13, 2026
19 of 20 checks passed
@Neverlord Neverlord deleted the gh-2294-speedup-cppcheck-ci branch April 13, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate cppcheck into our CI work flow

3 participants