Skip to content

Commit 089e83b

Browse files
author
Gonzalo Diaz
committed
[CONFIG] Sonarcloud script for github-actions.
1 parent af45cd3 commit 089e83b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ jobs:
3939
run: |
4040
New-Item -Path .\.sonar\scanner -ItemType Directory
4141
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42+
- name: Install Coverlet
43+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
44+
shell: powershell
45+
run: |
46+
dotnet tool install --global coverlet.console
4247
- name: Build and analyze
4348
env:
4449
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4550
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4651
shell: powershell
4752
run: |
4853
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sir-gon_algorithm-exercises-csharp" /o:"sir-gon" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
49-
dotnet restore
50-
dotnet build --no-restore
51-
dotnet test --no-build --verbosity normal
54+
dotnet build --no-incremental
55+
coverlet .\algorithm-exercises-csharp\bin\Debug\net8.0\algorithm-exercises-csharp-lib.dll
56+
--target "dotnet"
57+
--targetargs "test --no-build"
58+
-f=opencover
59+
-o="coverage.xml"
5260
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)