I am using PlatformIO for developing embedded sw, and wanted to try SonarCloud. (Currently using CppCheck and CodeCov)
In the ‘Automatic Analysis’ mode, everything was simple to setup, but it did not include the test-coverage, and because I already have a github Actions based CI workflow, I tried to include SonarCloud into the workflow.
For reference :
my (open source) repository
the workflow yml file
I had problems with getting the build-wrapper working (actually I just don’t understand what that is…) but I can generate Compilation Database (from PlatformIO CLI), and with the python script from this post, I was able to make it work.
So when the workflow runs, the results for static code analysis and unit testing coverage, are synced to my project on sonarcloud.io. Amazing.
But the analysis has a warning :
File
/home/runner/work/MuMo-v2-Node-SW/MuMo-v2-Node-SW/cfamily-compilation-database/build-wrapper-dump.json
was generated using build-wrapper version old,
which does not match the analyzer version 6.56.0.72172.
Please download the matching version from the server
https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
Additionally, the property 'sonar.cfamily.build-wrapper-output' is deprecated.
Please switch to 'sonar.cfamily.compile-commands' after using the matching version of build-wrapper.
Visit the documentation for more up-to-date information on analysis using build-wrapper https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/overview/
Is it possible to improve my CI script, or the convert-compile-commands.py script to get rid of this warning ? Or maybe get rid of the workaround and get the build-wrapper working ?