mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-28 23:03:24 +02:00
gitlab-ci: add static analysis check
Similar to the formatting check job, take advantage of the `clang-tidy` configuration we just created to add a new job running this tool. Running `clang-tidy` requires the following: * build dependencies must be present on the system so it can resolve the includes * the build folder must be configured as it relies on the `compile_commands.json` to get build flags (such as the include paths) This could be run in the `build` job, but it would make it harder to understand the actual underlying issue, so this is executed as a new, separate job, re-using the artifacts from the `build` job.
This commit is contained in:
@@ -37,3 +37,13 @@ format:
|
||||
- apt-get update
|
||||
- apt-get -y install ${BUILD_DEPS} clang-format-${CLANG_VERSION}
|
||||
- ninja -C build clang-format-check
|
||||
|
||||
check:
|
||||
stage: check
|
||||
dependencies:
|
||||
- build
|
||||
script:
|
||||
- apt-get update
|
||||
# clang-tidy needs all dependencies to be installed so it can inspect their headers
|
||||
- apt-get -y install ${BUILD_DEPS} clang-tidy-${CLANG_VERSION}
|
||||
- ninja -C build clang-tidy
|
||||
|
Reference in New Issue
Block a user