Skip to content

Commit 8262321

Browse files
authored
Use collect Code Coverage (#55)
1 parent 2735594 commit 8262321

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/sonarqube.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@ jobs:
3737
run: |
3838
New-Item -Path .\.sonar\scanner -ItemType Directory
3939
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
40+
- name: Install Dotnet Coverage
41+
shell: powershell
42+
run: |
43+
dotnet tool install --global dotnet-coverage
4044
- name: Build and analyze
4145
env:
4246
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4347
shell: powershell
4448
run: |
45-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"fustom_CloneDevOpsTemplate" /o:"fustom" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
46-
dotnet build
47-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
49+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"fustom_CloneDevOpsTemplate" /o:"fustom" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
50+
dotnet build --no-incremental
51+
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
52+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)