build: add cmake configure step to linting - #527
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an explicit CMake configure phase ahead of cppcheck so compile_commands.json exists, allowing the CI “lint” job to run without building.
Changes:
- Extracted Conan + CMake configure into a new
cmake_configure()helper. - Updated
build_project()andrun_lint()to invokecmake_configure()before build / cppcheck. - Removed the now-duplicate
conan_setupcall frombuild_target().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #527 +/- ##
===========================================
+ Coverage 85.26% 85.28% +0.02%
===========================================
Files 308 310 +2
Lines 27527 27763 +236
Branches 3716 3742 +26
===========================================
+ Hits 23470 23679 +209
- Misses 4057 4084 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mykola-kobets-epam
left a comment
There was a problem hiding this comment.
Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>
al1img
left a comment
There was a problem hiding this comment.
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
MykolaSuperman
left a comment
There was a problem hiding this comment.
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
0e72b0b to
dd161d1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
build.sh:66
conan_setupinstalls to--output-folder build, which is where Conan generatesconan_toolchain.cmake. The subsequent CMake configure uses-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake, but there is no such file at repo root, so configure/lint will fail. PointCMAKE_TOOLCHAIN_FILEat the toolchain under the build directory (e.g.,build/conan_toolchain.cmake) or adjust the Conan output folder accordingly.
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE="$ARG_BUILD_TYPE" \
-G "Unix Makefiles" \
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
compile_commands.json is generated during cmake configure step, so it should be run before cppcheck. This patch makes it possible to execute lint step without building the project, which fixes the issue with linting on CI. Signed-off-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com> Reviewed-by: Mykola Kobets <mykola_kobets@epam.com> Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com> Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
dd161d1 to
777789d
Compare
Signed-off-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com> Reviewed-by: Mykola Kobets <mykola_kobets@epam.com> Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com> Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Signed-off-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com> Reviewed-by: Mykola Kobets <mykola_kobets@epam.com> Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com> Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
777789d to
612f613
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
build.sh:66
conan installis configured with--output-folder build, so the generated CMake toolchain file will be underbuild/(e.g.,build/conan_toolchain.cmake). Passing-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmakepoints to a non-existent file in the repo root and will causecmake_configure(and thereforelint) to fail. Update the toolchain path to the location where Conan actually generates it (or compute an absolute path).
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE="$ARG_BUILD_TYPE" \
-G "Unix Makefiles" \
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|



compile_commands.json is generated during cmake configure step, so it should be run before cppcheck.
This patch makes it possible to execute lint step without building the project, which fixes the issue with linting on CI.