This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
.github/actions/perform-static-analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 run : |
4545 mkdir -p .sonar/scanner
4646 dotnet tool install dotnet-sonarscanner --tool-path ./.sonar/scanner
47- dotnet tool install dotnet-coverage --tool-path ./.sonar/scanner
47+ dotnet tool install dotnet-reportgenerator-globaltool --tool-path ./.sonar/scanner
48+
4849 - name : Build and analyze
4950 shell : bash
5051 run : |
Original file line number Diff line number Diff line change @@ -290,3 +290,5 @@ __queuestorage__
290290gitleaks-report.json
291291
292292coverage /
293+ .sonar /
294+ .sonarqube /
Original file line number Diff line number Diff line change @@ -6,12 +6,19 @@ set -euo pipefail
66: " ${SONAR_ORGANISATION_KEY:? SONAR_ORGANISATION_KEY is required} "
77
88SONAR_SCANNER=" ./.sonar/scanner/dotnet-sonarscanner"
9- COVERAGE_FILES= $( find coverage -name ' *.coverage.xml ' | paste -sd " , " - )
9+ REPORT_GENERATOR= " ./.sonar/scanner/reportgenerator "
1010
11- $SONAR_SCANNER begin /k:" $SONAR_PROJECT_KEY " /o:" $SONAR_ORGANISATION_KEY " /d:sonar.token=" $SONAR_TOKEN " /d:sonar.host.url=" https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=" $COVERAGE_FILES "
11+
12+
13+ $SONAR_SCANNER begin /k:" $SONAR_PROJECT_KEY " /o:" $SONAR_ORGANISATION_KEY " /d:sonar.token=" $SONAR_TOKEN " /d:sonar.host.url=" https://sonarcloud.io" /d:sonar.coverageReportPaths=" coverage/converted/SonarQube.xml"
1214
1315dotnet build src/ServiceLayer.sln
1416
15- make test-unit
17+ make test-unit ARGS=" --no-build"
18+
19+ $REPORT_GENERATOR \
20+ -reports:coverage/** /coverage.cobertura.xml \
21+ -targetdir:coverage/converted \
22+ -reporttypes:SonarQube
1623
1724$SONAR_SCANNER end /d:sonar.token=" $SONAR_TOKEN "
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33
4+ BUILD_ARGS=" "
5+ if [[ " ${1:- } " == " --no-build" ]]; then
6+ BUILD_ARGS=" --no-build"
7+ fi
8+
49COVERAGE_DIR=" coverage"
510TEST_PROJECTS=$( find tests -name ' *.csproj' )
611
@@ -11,5 +16,8 @@ for proj in $TEST_PROJECTS; do
1116 proj_name=$( basename " $proj " .csproj)
1217 out_file=" $COVERAGE_DIR /$proj_name .coverage.xml"
1318 echo " 🧪 Running coverage for $proj -> $out_file "
14- dotnet-coverage collect -f xml -o " $out_file " dotnet test " $proj "
19+ dotnet test " $proj " \
20+ $BUILD_ARGS \
21+ --collect:" XPlat Code Coverage" \
22+ --results-directory coverage
1523done
You can’t perform that action at this time.
0 commit comments