Skip to content

Commit

Permalink
.github/workflows/sonar.yml: Disable caching (for now) and only creat…
Browse files Browse the repository at this point in the history
…e directory if it doesn't already exist (#879)
  • Loading branch information
NightOwl888 authored Oct 19, 2023
1 parent 6883144 commit fad35d9
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fad35d9

Please sign in to comment.