File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -52,28 +52,17 @@ jobs:
52
52
path : ~/.sonar/cache
53
53
key : ${{ runner.os }}-sonar
54
54
restore-keys : ${{ runner.os }}-sonar
55
- - name : Cache SonarCloud scanner
56
- id : cache-sonar-scanner
57
- uses : actions/cache@v4
58
- with :
59
- path : ./.sonar/scanner
60
- key : ${{ runner.os }}-sonar-scanner
61
- restore-keys : ${{ runner.os }}-sonar-scanner
62
55
- name : Install SonarCloud scanner
63
- if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
64
- shell : pwsh
65
- run : |
66
- New-Item -Path ./.sonar/scanner -ItemType Directory
67
- dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
56
+ run : dotnet tool install dotnet-sonarscanner --create-manifest-if-needed
68
57
- name : Build and analyze
69
58
env :
70
59
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
71
60
CollectCoverage : true
72
61
CoverletOutputFormat : ' opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
73
62
shell : pwsh
74
63
run : |
75
- ./.sonar/scanner/ dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml"
64
+ dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.opencover.xml"
76
65
dotnet workload restore
77
66
dotnet build
78
67
dotnet test Microsoft.OpenApi.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
79
- ./.sonar/scanner/ dotnet-sonarscanner end
68
+ dotnet tool run dotnet -sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
You can’t perform that action at this time.
0 commit comments