Skip to content

Commit e41d88f

Browse files
thirtytwobitsScott DixonCopilot
authored
#171 update sonarqube action (#189)
Infrastructure only change. Unable to test this locally since that's not something github actions supports. This may or may not fix #171. --------- Co-authored-by: Scott Dixon <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent edc53f5 commit e41d88f

File tree

10 files changed

+141
-93
lines changed

10 files changed

+141
-93
lines changed

.github/workflows/cetlvast.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ jobs:
171171
- uses: actions/checkout@v4
172172
with:
173173
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis by sonarqube.
174-
- name: Install sonar-scanner
175-
uses: SonarSource/sonarcloud-github-c-cpp@v3
176-
177174
- name: Cache ext modules
178175
uses: actions/cache@v4
179176
with:
@@ -186,10 +183,29 @@ jobs:
186183
- name: Check for SONAR_TOKEN
187184
if: ${{ env.SONAR_TOKEN == '' && github.event_name != 'pull_request' }}
188185
run: echo "::error file=cetlvast.yml,line=191,col=8,endColumn=80,title=SONAR_TOKEN-missing::SONAR_TOKEN was empty or not found."
189-
- name: Run sonar-scanner
186+
- name: Run build for sonar-scanner
190187
if: ${{ env.SONAR_TOKEN != '' }}
191188
working-directory: cetlvast
192-
run: cmake --workflow --preset manual-sonar-scan-gcc-native-cpp-14-offline
189+
run: cmake --workflow --preset manual-coverage-gcc-native-cpp-14-offline
190+
- name: SonarQube Scan
191+
uses: SonarSource/[email protected]
192+
if: ${{ env.SONAR_TOKEN != '' }}
193+
with:
194+
args: >
195+
-Dsonar.organization=opencyphal
196+
-Dsonar.projectKey=OpenCyphal_CETL
197+
-Dsonar.projectName=CETLVaSt
198+
-Dsonar.verbose=true
199+
-Dsonar.cfamily.compile-commands=cetlvast/build/compile_commands.json
200+
-Dsonar.cfamily.cobertura.reportPaths=cetlvast/build/suites/unittest/coverage.xml
201+
-Dsonar.testExecutionReportPaths=cetlvast/build/suites/unittest/unittest-sonarqube.xml
202+
-Dsonar.sources="include,cetlvast/suites/unittest/sonar.cpp"
203+
-Dsonar.tests="cetlvast/suites/unittest"
204+
-Dsonar.test.inclusions="**/test_*.cpp"
205+
-Dsonar.cfamily.ignoreHeaderComments=false
206+
-Dsonar.coverage.exclusions="cetlvast/**/*,**/sonar.cpp"
207+
-Dsonar.cpd.exclusions="cetlvast/**/*,**/sonar.cpp"
208+
-Dsonar.cfamily.reportingCppStandardOverride=c++14
193209
194210
deploy-docs:
195211
if: >

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cmake.configureOnOpen": false,
33
"cmake.configureOnEdit": false,
4-
"cmake.buildDirectory": "${workspaceFolder}/build",
54
"cmake.sourceDirectory": "${workspaceFolder}/cetlvast",
65
"cmake.buildBeforeRun": true,
76
"editor.wordWrapColumn": 120,

cetlvast/CMakePresets.json

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,21 @@
499499
"gcovr_sonarqube_report_for_unittest",
500500
"run_examples",
501501
"gcovr_html_report_for_examples",
502-
"gcovr_sonarqube_report_for_examples",
503-
"sonar-cloud-scan-OpenCyphal_CETL"
502+
"gcovr_sonarqube_report_for_examples"
503+
]
504+
},
505+
{
506+
"name": "manual-Coverage-no-scan-gcc-native-cpp-14-offline",
507+
"configurePreset": "configure-gcc-native-cpp-14-offline",
508+
"configuration": "Coverage",
509+
"targets": [
510+
"build",
511+
"run_unittests",
512+
"gcovr_html_report_for_unittest",
513+
"gcovr_sonarqube_report_for_unittest",
514+
"run_examples",
515+
"gcovr_html_report_for_examples",
516+
"gcovr_sonarqube_report_for_examples"
504517
]
505518
},
506519
{
@@ -1714,8 +1727,7 @@
17141727
"gcovr_sonarqube_report_for_unittest",
17151728
"run_examples",
17161729
"gcovr_html_report_for_examples",
1717-
"gcovr_sonarqube_report_for_examples",
1718-
"sonar-cloud-scan-OpenCyphal_CETL"
1730+
"gcovr_sonarqube_report_for_examples"
17191731
]
17201732
},
17211733
{
@@ -1729,8 +1741,7 @@
17291741
"gcovr_sonarqube_report_for_unittest",
17301742
"run_examples",
17311743
"gcovr_html_report_for_examples",
1732-
"gcovr_sonarqube_report_for_examples",
1733-
"sonar-cloud-scan-OpenCyphal_CETL"
1744+
"gcovr_sonarqube_report_for_examples"
17341745
]
17351746
},
17361747
{
@@ -1744,8 +1755,7 @@
17441755
"gcovr_sonarqube_report_for_unittest",
17451756
"run_examples",
17461757
"gcovr_html_report_for_examples",
1747-
"gcovr_sonarqube_report_for_examples",
1748-
"sonar-cloud-scan-OpenCyphal_CETL"
1758+
"gcovr_sonarqube_report_for_examples"
17491759
]
17501760
},
17511761
{
@@ -1759,8 +1769,7 @@
17591769
"gcovr_sonarqube_report_for_unittest",
17601770
"run_examples",
17611771
"gcovr_html_report_for_examples",
1762-
"gcovr_sonarqube_report_for_examples",
1763-
"sonar-cloud-scan-OpenCyphal_CETL"
1772+
"gcovr_sonarqube_report_for_examples"
17641773
]
17651774
},
17661775
{
@@ -1774,8 +1783,7 @@
17741783
"gcovr_sonarqube_report_for_unittest",
17751784
"run_examples",
17761785
"gcovr_html_report_for_examples",
1777-
"gcovr_sonarqube_report_for_examples",
1778-
"sonar-cloud-scan-OpenCyphal_CETL"
1786+
"gcovr_sonarqube_report_for_examples"
17791787
]
17801788
},
17811789
{
@@ -1789,8 +1797,7 @@
17891797
"gcovr_sonarqube_report_for_unittest",
17901798
"run_examples",
17911799
"gcovr_html_report_for_examples",
1792-
"gcovr_sonarqube_report_for_examples",
1793-
"sonar-cloud-scan-OpenCyphal_CETL"
1800+
"gcovr_sonarqube_report_for_examples"
17941801
]
17951802
},
17961803
{
@@ -1804,8 +1811,7 @@
18041811
"gcovr_sonarqube_report_for_unittest",
18051812
"run_examples",
18061813
"gcovr_html_report_for_examples",
1807-
"gcovr_sonarqube_report_for_examples",
1808-
"sonar-cloud-scan-OpenCyphal_CETL"
1814+
"gcovr_sonarqube_report_for_examples"
18091815
]
18101816
},
18111817
{
@@ -1819,8 +1825,7 @@
18191825
"gcovr_sonarqube_report_for_unittest",
18201826
"run_examples",
18211827
"gcovr_html_report_for_examples",
1822-
"gcovr_sonarqube_report_for_examples",
1823-
"sonar-cloud-scan-OpenCyphal_CETL"
1828+
"gcovr_sonarqube_report_for_examples"
18241829
]
18251830
},
18261831
{
@@ -1834,8 +1839,7 @@
18341839
"gcovr_sonarqube_report_for_unittest",
18351840
"run_examples",
18361841
"gcovr_html_report_for_examples",
1837-
"gcovr_sonarqube_report_for_examples",
1838-
"sonar-cloud-scan-OpenCyphal_CETL"
1842+
"gcovr_sonarqube_report_for_examples"
18391843
]
18401844
},
18411845
{
@@ -1849,8 +1853,7 @@
18491853
"gcovr_sonarqube_report_for_unittest",
18501854
"run_examples",
18511855
"gcovr_html_report_for_examples",
1852-
"gcovr_sonarqube_report_for_examples",
1853-
"sonar-cloud-scan-OpenCyphal_CETL"
1856+
"gcovr_sonarqube_report_for_examples"
18541857
]
18551858
},
18561859
{
@@ -1864,8 +1867,7 @@
18641867
"gcovr_sonarqube_report_for_unittest",
18651868
"run_examples",
18661869
"gcovr_html_report_for_examples",
1867-
"gcovr_sonarqube_report_for_examples",
1868-
"sonar-cloud-scan-OpenCyphal_CETL"
1870+
"gcovr_sonarqube_report_for_examples"
18691871
]
18701872
},
18711873
{
@@ -1879,8 +1881,7 @@
18791881
"gcovr_sonarqube_report_for_unittest",
18801882
"run_examples",
18811883
"gcovr_html_report_for_examples",
1882-
"gcovr_sonarqube_report_for_examples",
1883-
"sonar-cloud-scan-OpenCyphal_CETL"
1884+
"gcovr_sonarqube_report_for_examples"
18841885
]
18851886
},
18861887
{
@@ -1894,8 +1895,7 @@
18941895
"gcovr_sonarqube_report_for_unittest",
18951896
"run_examples",
18961897
"gcovr_html_report_for_examples",
1897-
"gcovr_sonarqube_report_for_examples",
1898-
"sonar-cloud-scan-OpenCyphal_CETL"
1898+
"gcovr_sonarqube_report_for_examples"
18991899
]
19001900
},
19011901
{
@@ -1909,8 +1909,7 @@
19091909
"gcovr_sonarqube_report_for_unittest",
19101910
"run_examples",
19111911
"gcovr_html_report_for_examples",
1912-
"gcovr_sonarqube_report_for_examples",
1913-
"sonar-cloud-scan-OpenCyphal_CETL"
1912+
"gcovr_sonarqube_report_for_examples"
19141913
]
19151914
},
19161915
{
@@ -1924,8 +1923,7 @@
19241923
"gcovr_sonarqube_report_for_unittest",
19251924
"run_examples",
19261925
"gcovr_html_report_for_examples",
1927-
"gcovr_sonarqube_report_for_examples",
1928-
"sonar-cloud-scan-OpenCyphal_CETL"
1926+
"gcovr_sonarqube_report_for_examples"
19291927
]
19301928
},
19311929
{
@@ -1939,8 +1937,7 @@
19391937
"gcovr_sonarqube_report_for_unittest",
19401938
"run_examples",
19411939
"gcovr_html_report_for_examples",
1942-
"gcovr_sonarqube_report_for_examples",
1943-
"sonar-cloud-scan-OpenCyphal_CETL"
1940+
"gcovr_sonarqube_report_for_examples"
19441941
]
19451942
},
19461943
{
@@ -1954,8 +1951,7 @@
19541951
"gcovr_sonarqube_report_for_unittest",
19551952
"run_examples",
19561953
"gcovr_html_report_for_examples",
1957-
"gcovr_sonarqube_report_for_examples",
1958-
"sonar-cloud-scan-OpenCyphal_CETL"
1954+
"gcovr_sonarqube_report_for_examples"
19591955
]
19601956
},
19611957
{
@@ -1969,8 +1965,7 @@
19691965
"gcovr_sonarqube_report_for_unittest",
19701966
"run_examples",
19711967
"gcovr_html_report_for_examples",
1972-
"gcovr_sonarqube_report_for_examples",
1973-
"sonar-cloud-scan-OpenCyphal_CETL"
1968+
"gcovr_sonarqube_report_for_examples"
19741969
]
19751970
},
19761971
{
@@ -1984,8 +1979,7 @@
19841979
"gcovr_sonarqube_report_for_unittest",
19851980
"run_examples",
19861981
"gcovr_html_report_for_examples",
1987-
"gcovr_sonarqube_report_for_examples",
1988-
"sonar-cloud-scan-OpenCyphal_CETL"
1982+
"gcovr_sonarqube_report_for_examples"
19891983
]
19901984
},
19911985
{
@@ -1999,8 +1993,7 @@
19991993
"gcovr_sonarqube_report_for_unittest",
20001994
"run_examples",
20011995
"gcovr_html_report_for_examples",
2002-
"gcovr_sonarqube_report_for_examples",
2003-
"sonar-cloud-scan-OpenCyphal_CETL"
1996+
"gcovr_sonarqube_report_for_examples"
20041997
]
20051998
},
20061999
{
@@ -2014,8 +2007,7 @@
20142007
"gcovr_sonarqube_report_for_unittest",
20152008
"run_examples",
20162009
"gcovr_html_report_for_examples",
2017-
"gcovr_sonarqube_report_for_examples",
2018-
"sonar-cloud-scan-OpenCyphal_CETL"
2010+
"gcovr_sonarqube_report_for_examples"
20192011
]
20202012
},
20212013
{
@@ -2029,8 +2021,7 @@
20292021
"gcovr_sonarqube_report_for_unittest",
20302022
"run_examples",
20312023
"gcovr_html_report_for_examples",
2032-
"gcovr_sonarqube_report_for_examples",
2033-
"sonar-cloud-scan-OpenCyphal_CETL"
2024+
"gcovr_sonarqube_report_for_examples"
20342025
]
20352026
},
20362027
{
@@ -2044,8 +2035,7 @@
20442035
"gcovr_sonarqube_report_for_unittest",
20452036
"run_examples",
20462037
"gcovr_html_report_for_examples",
2047-
"gcovr_sonarqube_report_for_examples",
2048-
"sonar-cloud-scan-OpenCyphal_CETL"
2038+
"gcovr_sonarqube_report_for_examples"
20492039
]
20502040
},
20512041
{
@@ -2059,8 +2049,7 @@
20592049
"gcovr_sonarqube_report_for_unittest",
20602050
"run_examples",
20612051
"gcovr_html_report_for_examples",
2062-
"gcovr_sonarqube_report_for_examples",
2063-
"sonar-cloud-scan-OpenCyphal_CETL"
2052+
"gcovr_sonarqube_report_for_examples"
20642053
]
20652054
},
20662055
{
@@ -2074,8 +2063,7 @@
20742063
"gcovr_sonarqube_report_for_unittest",
20752064
"run_examples",
20762065
"gcovr_html_report_for_examples",
2077-
"gcovr_sonarqube_report_for_examples",
2078-
"sonar-cloud-scan-OpenCyphal_CETL"
2066+
"gcovr_sonarqube_report_for_examples"
20792067
]
20802068
},
20812069
{
@@ -2089,8 +2077,7 @@
20892077
"gcovr_sonarqube_report_for_unittest",
20902078
"run_examples",
20912079
"gcovr_html_report_for_examples",
2092-
"gcovr_sonarqube_report_for_examples",
2093-
"sonar-cloud-scan-OpenCyphal_CETL"
2080+
"gcovr_sonarqube_report_for_examples"
20942081
]
20952082
}
20962083
],
@@ -2140,6 +2127,21 @@
21402127
}
21412128
]
21422129
},
2130+
{
2131+
"name": "manual-coverage-gcc-native-cpp-14-offline",
2132+
"displayName": "gcc native cpp 14 offline (Coverage only).",
2133+
"description": "Hand-managed workflow for generating coverage data for sonarqube scans.",
2134+
"steps": [
2135+
{
2136+
"type": "configure",
2137+
"name": "configure-gcc-native-cpp-14-offline"
2138+
},
2139+
{
2140+
"type": "build",
2141+
"name": "manual-Coverage-no-scan-gcc-native-cpp-14-offline"
2142+
}
2143+
]
2144+
},
21432145
{
21442146
"name": "lint-workflow-clang-native-cpp-14-online",
21452147
"displayName": "clang native cpp 14 online lint workflow.",
@@ -3053,8 +3055,7 @@
30533055
"gcovr_sonarqube_report_for_unittest",
30543056
"run_examples",
30553057
"gcovr_html_report_for_examples",
3056-
"gcovr_sonarqube_report_for_examples",
3057-
"sonar-cloud-scan-OpenCyphal_CETL"
3058+
"gcovr_sonarqube_report_for_examples"
30583059
]
30593060
},
30603061
"preset-groups": {

cetlvast/CMakePresetsVendorTemplate.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"gcovr_sonarqube_report_for_unittest",
4040
"run_examples",
4141
"gcovr_html_report_for_examples",
42-
"gcovr_sonarqube_report_for_examples",
43-
"sonar-cloud-scan-OpenCyphal_CETL"
42+
"gcovr_sonarqube_report_for_examples"
4443
]
4544
},
4645
"preset-groups": {

0 commit comments

Comments
 (0)