Skip to content

Commit

Permalink
- removes scanner caching as invalidation doesnt work as expected and…
Browse files Browse the repository at this point in the history
… there's no way to make it work without maintaining another version file

Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed May 6, 2024
1 parent 9feedd0 commit d987175
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,20 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar-${{ hashFiles('~/.sonar/cache/**') }}
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner-${{ hashFiles('./.sonar/scanner/**') }}
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
shell: pwsh
run: |
New-Item -Path ./.sonar/scanner -ItemType Directory -Force
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
dotnet tool install dotnet-sonarscanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
CollectCoverage: true
CoverletOutputFormat: "opencover" # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
shell: pwsh
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="tests/**/coverage.opencover.xml"
dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="tests/**/coverage.opencover.xml"
dotnet build
dotnet test kiota.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit d987175

Please sign in to comment.