11name : SonarCloud code analysis
22
3- on : [push]
3+ on : [push, pull_request, pull_request_target ]
44
55jobs :
66 analyze :
1616 - name : Setup dotnet
1717 uses : actions/setup-dotnet@v4
1818 with :
19- dotnet-version : 6 .0.x # SDK Version to use.
19+ dotnet-version : 8 .0.x # SDK Version to use.
2020
2121 - name : Set up JDK 21
2222 uses : actions/setup-java@v4
@@ -42,16 +42,16 @@ jobs:
4242 key : ${{ runner.os }}-sonar
4343 restore-keys : ${{ runner.os }}-sonar
4444
45- - name : Cache SonarCloud scanner
46- id : cache-sonar-scanner
47- uses : actions/cache@v4
48- with :
49- path : .\.sonar\scanner
50- key : ${{ runner.os }}-sonar-scanner
51- restore-keys : ${{ runner.os }}-sonar-scanner
45+ # - name: Cache SonarCloud scanner
46+ # id: cache-sonar-scanner
47+ # uses: actions/cache@v4
48+ # with:
49+ # path: .\.sonar\scanner
50+ # key: ${{ runner.os }}-sonar-scanner
51+ # restore-keys: ${{ runner.os }}-sonar-scanner
5252
5353 - name : Install SonarCloud scanner
54- if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
54+ # if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
5555 shell : powershell
5656 run : |
5757 New-Item -Path .\.sonar\scanner -ItemType Directory
6363 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
6464 shell : powershell
6565 run : |
66- .\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.login ="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
66+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.token ="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
6767 dotnet build --configuration Release --no-restore src/WebEid.Security.sln
6868 dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
69- .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login ="${{ secrets.SONAR_TOKEN }}"
69+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token ="${{ secrets.SONAR_TOKEN }}"
0 commit comments