From 9365e2649fcd8e5f7b03a8a421b77928ec3febd1 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Tue, 29 Aug 2023 22:48:43 -0500 Subject: [PATCH] ci: fix sonarcloud deprecations - Use `sonar.token` instead of `sonar.login` since the latter is deprecated. - Explicitly install Java 17 since v11 (bundled by default) is deprecated by Sonarcloud. Caching was not implemented this time around because it's not possible to cache analysis results yet, only the installed binaries. See this thread for information: https://community.sonarsource.com/t/proper-caching-for-ci-builds/98320/2 --- .github/workflows/sonarcloud.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 5ed2759e..fb168b58 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -28,6 +28,13 @@ jobs: with: fetch-depth: 0 # avoid shallow clone for GitVersion + # GH Runners come with Java 11, which is deprecated by Sonarcloud + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - name: Setup dotnet uses: actions/setup-dotnet@v3 with: @@ -52,7 +59,7 @@ jobs: -k:"recyclarr_recyclarr" -n:"Recyclarr" -v:"${{ steps.gitversion.outputs.fullSemVer }}" - -d:sonar.login="${{ secrets.SONAR_TOKEN }}" + -d:sonar.token="${{ secrets.SONAR_TOKEN }}" -d:sonar.host.url="https://sonarcloud.io" -d:sonar.cs.opencover.reportsPaths="**/TestResults/*/coverage.opencover.xml" @@ -67,4 +74,4 @@ jobs: - name: End Sonar Scanner run: > dotnet sonarscanner end - -d:sonar.login="${{ secrets.SONAR_TOKEN }}" + -d:sonar.token="${{ secrets.SONAR_TOKEN }}"