Update actions/cache digest to 1bd1e32 #612
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "SonarCloud" | |
on: | |
push: | |
branches: [develop, main] | |
pull_request: | |
branches: [develop, main] | |
workflow_dispatch: | |
jobs: | |
analyze: | |
name: Analyze | |
runs-on: windows-latest | |
# currently SonarCloud does not support running PR analysis on external PRs. | |
# vote for it here: https://portal.productboard.com/sonarsource/1-sonarcloud/c/50-sonarcloud-analyzes-external-pull-request?utm_medium=social&utm_source=portal_share | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Cache Cake-Tools | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: tools | |
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} | |
- name: Cache SonarCloud packages | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache SonarCloud scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Install SonarCloud scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
shell: powershell | |
run: | | |
New-Item -Path .\.sonar\scanner -ItemType Directory | |
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | |
- name: Install .NET | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
with: | |
dotnet-version: | | |
3.1.x | |
5.0.x | |
6.0.x | |
7.0.x | |
- name: Set up JDK 17 | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' # Alternative distribution options are available. | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"nils-org_fluentcamlgen" /o:"nils-org" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | |
.\build.ps1 --target=DotNetCore-Build | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |