This project is analysed on SonarCloud!
The build-analyze.ps1
script demonstrates how to run an analysis on a C++ project build.
GitHub actions are used for demonstration purposes as any CI could be used to run the build-analyze.ps1
script.
Note that for security reasons, the token SONARCLOUD_TOKEN
used in this example project is defined in the environment through GitHub secrets. It should not be made public.
You can take a look at the script build-analyze.ps1 of this project to see it in practice.
💡
|
This example works with SonarQube too: set the property sonar.host.url to the URL of your SonarQube server and download the Build Wrapper from your SonarQube server.
|
A build of the code repository on Windows platform using CMake build system.
To build the code run:
mkdir build && cd build cmake .. msbuild sonar_scanner_example.vcxproj
An example of a flawed C++ code. The code repository can be analyzed automatically, but it can also be compiled with different build systems using different CI pipelines on Linux, macOS, and Windows.
The code repository is forked into other repositories in this collection to add a specific build system, platform, and CI. The downstream repositories are analyzed either with SonarQube or SonarCloud.
You can find examples for:
Using the following build systems:
Running on the following CI services:
-
Additionally, generic examples demonstrate integration with other CIs and manual-configuration examples should help you if you are running locally.
Configured for analysis on:
You can find also a few examples demonstrating:
See examples-structure.adoc for a description of the structure of this GitHub organization and the relations between its different repositories.