File tree 3 files changed +14
-5
lines changed
algorithm-exercises-csharp-test
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,22 @@ jobs:
39
39
run : |
40
40
New-Item -Path .\.sonar\scanner -ItemType Directory
41
41
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
42
47
- name : Build and analyze
43
48
env :
44
49
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
45
50
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
46
51
shell : powershell
47
52
run : |
48
53
.\.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"
52
60
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
Original file line number Diff line number Diff line change @@ -138,5 +138,7 @@ _NCrunch*
138
138
139
139
# Coverage
140
140
coverage.cobertura.xml
141
+ coverage.opencover.xml
142
+ coverage.info
141
143
coverage.json
142
144
lcov.info
Original file line number Diff line number Diff line change 13
13
14
14
<!-- Coverage -->
15
15
<CollectCoverage >true</CollectCoverage >
16
- <CoverletOutputFormat >lcov</CoverletOutputFormat >
17
- <CoverletOutput >./lcov.info</CoverletOutput >
16
+ <CoverletOutputFormat >lcov,opencover</CoverletOutputFormat >
18
17
<IncludeTestAssembly >true</IncludeTestAssembly >
19
18
20
19
<!-- Static Analysis -->
You can’t perform that action at this time.
0 commit comments