99 runs-on : windows-latest
1010
1111 steps :
12+ - name : Unset CACHE_VERSION
13+ shell : powershell
14+ run : |
15+ Remove-Item Env:CACHE_VERSION -ErrorAction SilentlyContinue
16+ Write-Host "CACHE_VERSION has been unset"
17+
1218 - uses : actions/checkout@v4
1319 with :
1420 fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
3541 - name : Install dependencies
3642 run : dotnet restore src/WebEid.Security.sln
3743
38- - name : Cache SonarCloud packages
39- uses : actions/cache@v4
40- with :
41- path : ~/.sonar/cache
42- key : ${{ runner.os }}-sonar
43- restore-keys : ${{ runner.os }}-sonar
44-
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
52-
5344 - name : Install SonarCloud scanner
54- if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
5545 shell : powershell
5646 run : |
5747 New-Item -Path .\.sonar\scanner -ItemType Directory
@@ -61,18 +51,17 @@ jobs:
6151 env :
6252 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6353 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
64- CACHE_VERSION : ${{ vars.CACHE_VERSION }}
6554 shell : powershell
6655 run : |
6756 Write-Host "Branch: ${{ github.ref_name }}"
6857 Write-Host "Repository: ${{ github.repository }}"
6958 Write-Host "Event: ${{ github.event_name }}"
59+ Write-Host "CACHE_VERSION value: '$env:CACHE_VERSION'"
7060 if ("${{ secrets.SONAR_TOKEN }}" -eq "") {
7161 Write-Host "SONAR_TOKEN is missing"
7262 } else {
73- Write-Host "SONAR_TOKEN is available -3 (length: $("${{ secrets.SONAR_TOKEN }}".Length))"
63+ Write-Host "SONAR_TOKEN is available -4 (length: $("${{ secrets.SONAR_TOKEN }}".Length))"
7464 }
75- Remove-Item Env:CACHE_VERSION -ErrorAction SilentlyContinue
7665 .\.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"
7766 dotnet build --configuration Release --no-restore src/WebEid.Security.sln
7867 dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
0 commit comments