Skip to content

CI workflow to run GCC static analyzer#125

Closed
greenc-FNAL wants to merge 3 commits intomainfrom
jules-feature-add-gcc-analyzer-workflow
Closed

CI workflow to run GCC static analyzer#125
greenc-FNAL wants to merge 3 commits intomainfrom
jules-feature-add-gcc-analyzer-workflow

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

  • feature: Add GCC static analyzer workflow
  • feat: Modernize gcc-analyzer-check workflow

This commit introduces a new GitHub Actions workflow to build the project with the GCC static analyzer enabled. This provides a valuable second opinion on code quality and helps ensure compatibility with both Clang and GCC, complementing the existing clang-tidy checks.

The implementation follows the project's established conventions by:
- Adding a new `ENABLE_GCC_ANALYZER` option to the CMake configuration.
- Encapsulating the analyzer logic in a dedicated CMake module, `Modules/private/EnableGccAnalyzer.cmake`.
- Creating a new workflow file, `.github/workflows/gcc-analyzer-check.yaml`, that leverages the project's reusable actions for a consistent CI setup.
Brings the `gcc-analyzer-check.yaml` workflow up to date with practices in other workflows.

- Pins the `actions/checkout` action to a specific commit hash for security and reproducibility.
- Uses the `@main` branch reference for reusable actions to prevent executing un-reviewed code from a pull request.
- Sets explicit, minimal `permissions` for each job to follow the principle of least privilege.
@github-actions
Copy link
Copy Markdown
Contributor

Review the full CodeQL report for details.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
- Coverage   80.31%   80.15%   -0.16%     
==========================================
  Files         115      115              
  Lines        1910     1910              
  Branches      302      302              
==========================================
- Hits         1534     1531       -3     
- Misses        247      249       +2     
- Partials      129      130       +1     
Flag Coverage Δ
unittests 80.15% <ø> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53e5ee7...f2c8197. Read the comment docs.

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

@knoepfel
Copy link
Copy Markdown
Member

@greenc-FNAL, I'm sorry to say that I don't think we can include this check in our list of checks. At the top of https://gcc.gnu.org/wiki/StaticAnalyzer:

Only C is currently supported (I hope to support C++ in GCC 16, but it is out-of-scope for GCC 15)

I think we'll need to rely on clang-tidy for now.

@knoepfel knoepfel closed this Nov 20, 2025
@greenc-FNAL greenc-FNAL deleted the jules-feature-add-gcc-analyzer-workflow branch February 17, 2026 17:57
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.

2 participants