From 88220195ed0af30062172ce96d745e907981c699 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 May 2024 13:40:27 -0400 Subject: [PATCH 1/3] - replaces sonar login by token --- .github/workflows/sonarcloud.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index dc0a104..b229810 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -73,8 +73,8 @@ jobs: CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-authentication-azure-dotnet" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Authentication.Azure.Tests/coverage.net8.0.opencover.xml" + ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-authentication-azure-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Authentication.Azure.Tests/coverage.net8.0.opencover.xml" dotnet workload restore dotnet build dotnet test Microsoft.Kiota.Authentication.Azure.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0 - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file From 0ca0edd3d2a3563421cc55b4db74cdddb58f15c5 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 May 2024 13:58:58 -0400 Subject: [PATCH 2/3] - removes unnecessary parameter --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b229810..c95c323 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -77,4 +77,4 @@ jobs: dotnet workload restore dotnet build dotnet test Microsoft.Kiota.Authentication.Azure.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0 - ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + ./.sonar/scanner/dotnet-sonarscanner end \ No newline at end of file From 6bbb394df1eee0dcd25c85a70a7c0ee12a4fcf9c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 6 May 2024 15:57:27 -0400 Subject: [PATCH 3/3] - removes caching due to invalidation problems --- .github/workflows/sonarcloud.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c95c323..1f11af9 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -53,19 +53,8 @@ jobs: path: ~/.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 - restore-keys: ${{ runner.os }}-sonar-scanner - name: Install SonarCloud scanner - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - shell: pwsh - run: | - New-Item -Path ./.sonar/scanner -ItemType Directory - dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + run: dotnet tool install dotnet-sonarscanner --create-manifest-if-needed - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any @@ -73,8 +62,8 @@ jobs: CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-authentication-azure-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Authentication.Azure.Tests/coverage.net8.0.opencover.xml" + dotnet tool run dotnet-sonarscanner begin /k:"microsoft_kiota-authentication-azure-dotnet" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Authentication.Azure.Tests/coverage.net8.0.opencover.xml" dotnet workload restore dotnet build dotnet test Microsoft.Kiota.Authentication.Azure.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --framework net8.0 - ./.sonar/scanner/dotnet-sonarscanner end \ No newline at end of file + dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file