From fad35d9b65dd006f80d33e40b0fce506068029cd Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 19 Oct 2023 14:56:56 +0700 Subject: [PATCH] .github/workflows/sonar.yml: Disable caching (for now) and only create directory if it doesn't already exist (#879) --- .github/workflows/sonar.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index c9c9799a7d..8dcbb3ac98 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -46,26 +46,27 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v3 - with: - path: .\.sonar\scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner + #- name: Cache SonarCloud packages + # uses: actions/cache@v3 + # with: + # path: ~\sonar\cache + # key: ${{ runner.os }}-sonar + # restore-keys: ${{ runner.os }}-sonar + #- name: Cache SonarCloud scanner + # id: cache-sonar-scanner + # uses: actions/cache@v3 + # 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: powershell run: | - New-Item -Path .\.sonar\scanner -ItemType Directory + $dir = '.\.sonar\scanner' + if (!(Test-Path $dir)) { New-Item -Path $dir -ItemType Directory } # NOTE: Using 5.8.0 when the sonar scan was first added because that is likely the version that was in the cache - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner --version 5.8.0 + dotnet tool update dotnet-sonarscanner --tool-path $dir --version 5.8.0 - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any