Merge pull request 'ci(sonar): collect and upload OpenCover coverage from CI scan' (#18) from chore/ci-coverage-reporting into main
SonarQube Analysis / sonarqube (push) Successful in 4m8s

Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
2026-05-27 15:37:29 -05:00
+8 -18
View File
@@ -50,29 +50,19 @@ jobs:
/d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" \
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
/d:sonar.exclusions="**/bin/**,**/obj/**" \
/d:sonar.coverage.exclusions="tests/**,**/*.Tests/**" \
/d:sonar.cs.opencover.reportsPaths="tests/**/TestResults/**/coverage.opencover.xml" \
/d:sonar.verbose=true
- name: 7. Build
run: dotnet build Strata.SqlTools.QueryBreakdown.sln --configuration Release
- name: 8. Test plugins endpoint from runner
if: false
- name: 8. Test with coverage
run: |
echo "Test 1: curl with token via Basic auth"
curl -s -w "\nHTTP %{http_code}\n" \
-u "${{ secrets.SONAR_TOKEN }}:" \
"${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2
echo "---"
echo "Test 2: curl with token via Bearer auth"
curl -s -w "\nHTTP %{http_code}\n" \
-H "Authorization: Bearer ${{ secrets.SONAR_TOKEN }}" \
"${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2
echo "---"
echo "Test 3: same Java User-Agent the scanner uses"
curl -s -w "\nHTTP %{http_code}\n" \
-u "${{ secrets.SONAR_TOKEN }}:" \
-H "User-Agent: ScannerCLI/5.0.2.4997" \
"${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2
dotnet test Strata.SqlTools.QueryBreakdown.sln \
--configuration Release --no-build \
--settings coverlet.runsettings \
--collect "XPlat Code Coverage"
- name: 9. SonarScanner End
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"