From d9871757f1b4758a53588279753e2f35f445cb89 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 May 2024 14:58:01 -0400 Subject: [PATCH] - removes scanner caching as invalidation doesnt work as expected and there's no way to make it work without maintaining another version file Signed-off-by: Vincent Biret --- .github/workflows/sonarcloud.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 9bb78fe7b5..d926f2e1c6 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -69,20 +69,12 @@ 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 @@ -90,7 +82,7 @@ jobs: 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 }}"