Skip to content

Commit 02a7be5

Browse files
committed
Update SonarQube settings
1 parent 2a9cdd7 commit 02a7be5

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

.github/workflows/sonarcloud_analysis.yml .github/workflows/sonarcloud-analysis.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,22 @@ jobs:
2424
- name: Set up msbuild
2525
uses: microsoft/setup-msbuild@v2
2626

27-
- name: Install sonar-scanner and build-wrapper
28-
uses: SonarSource/sonarcloud-github-c-cpp@v3
27+
- name: Install Build Wrapper
28+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5
2929

3030
- name: Restore NuGet packages
31-
working-directory: ${{env.GITHUB_WORKSPACE}}
32-
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
31+
working-directory: ${{ env.GITHUB_WORKSPACE }}
32+
run: nuget restore ${{ env.SOLUTION_FILE_PATH }}
3333

3434
- name: Run build-wrapper
3535
run: |
3636
build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} msbuild netpbm-wic-codec.sln /t:netpbm-wic-codec:rebuild /p:Configuration="Release" /p:Platform="x64" /nodeReuse:false
3737
38-
- name: Run sonar-scanner
38+
- name: SonarQube Scan
39+
uses: SonarSource/sonarqube-scan-action@v5
3940
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here
42-
run: |
43-
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
41+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42+
with:
43+
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
44+
args: >
45+
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"

Directory.Build.props

+6-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<MultiProcessorCompilation>true</MultiProcessorCompilation>
5353

5454
<!-- Explicit define that all projects are compiled according the draft C++23 standard -->
55-
<LanguageStandard>stdcpp23</LanguageStandard>
55+
<LanguageStandard>stdcpplatest</LanguageStandard>
5656
<UseStandardPreprocessor>true</UseStandardPreprocessor>
5757

5858
<!-- To ensure high quality C++ code use warning level 4 and treat warnings as errors to ensure warnings are fixed promptly. -->
@@ -172,7 +172,6 @@
172172
<EnableCppCoreCheck>true</EnableCppCoreCheck>
173173
<EnableMicrosoftCodeAnalysis>true</EnableMicrosoftCodeAnalysis>
174174
<EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis>
175-
<WholeProgramOptimization>true</WholeProgramOptimization>
176175
</PropertyGroup>
177176

178177
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
@@ -186,10 +185,15 @@
186185
<FunctionLevelLinking>true</FunctionLevelLinking>
187186
<IntrinsicFunctions>true</IntrinsicFunctions>
188187
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
188+
<WholeProgramOptimization>true</WholeProgramOptimization>
189+
190+
<!-- Enable Optimize Global Data (/Gw). off by default -->
191+
<AdditionalOptions>/Gw /Zc:checkGwOdr %(AdditionalOptions)</AdditionalOptions>
189192
</ClCompile>
190193
<Link>
191194
<EnableCOMDATFolding>true</EnableCOMDATFolding>
192195
<OptimizeReferences>true</OptimizeReferences>
196+
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
193197

194198
<!-- Store only the filename of the PDB file into the .exe/.dll for deterministic builds and use /Brepo. -->
195199
<AdditionalOptions>/PDBALTPATH:%_PDB% /Brepro %(AdditionalOptions)</AdditionalOptions>

sonar-project.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ sonar.sources = src/
1212
sonar.tests = test/
1313

1414
# Encoding of the source code files. Default is the default system encoding, which is not correct.
15-
sonar.sourceEncoding=UTF-8
15+
sonar.sourceEncoding = UTF-8
16+
17+
sonar.cfamily.enableModules = true

0 commit comments

Comments
 (0)