Skip to content

Commit 60f63be

Browse files
authored
Update sonar.yml
1 parent c7d7d8e commit 60f63be

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

.github/workflows/sonar.yml

+9-16
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,46 @@ on:
1616
- 'Assets/**'
1717
- '**/assets/**'
1818
- '.github/**'
19-
2019
jobs:
2120
build:
22-
21+
name: Build and analyze
2322
runs-on: windows-latest
24-
2523
steps:
2624
- name: Set up JDK 11
27-
uses: actions/setup-java@v1
25+
uses: actions/setup-java@v3
2826
with:
29-
java-version: 1.11
30-
31-
- uses: actions/checkout@v2
27+
java-version: 11
28+
distribution: 'zulu' # Alternative distribution options are available.
29+
- uses: actions/checkout@v3
3230
with:
3331
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
34-
3532
- name: Cache SonarCloud packages
36-
uses: actions/cache@v1
33+
uses: actions/cache@v3
3734
with:
3835
path: ~\sonar\cache
3936
key: ${{ runner.os }}-sonar
4037
restore-keys: ${{ runner.os }}-sonar
41-
4238
- name: Cache SonarCloud scanner
4339
id: cache-sonar-scanner
44-
uses: actions/cache@v1
40+
uses: actions/cache@v3
4541
with:
4642
path: .\.sonar\scanner
4743
key: ${{ runner.os }}-sonar-scanner
4844
restore-keys: ${{ runner.os }}-sonar-scanner
49-
5045
- name: Install SonarCloud scanner
5146
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
5247
shell: powershell
5348
run: |
5449
New-Item -Path .\.sonar\scanner -ItemType Directory
5550
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
56-
5751
- name: Test
5852
run: dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Program.cs
59-
6053
- name: Build and analyze
6154
env:
6255
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6356
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6457
shell: powershell
6558
run: |
66-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sandeshkota_DesignPatterns" /o:"sandeshkota" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="DesignPatternTests\TestResults\*\coverage.opencover.xml"
59+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sandeshkota_DesignPatterns" /o:"sandeshkota" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="DesignPatternTests\TestResults\*\coverage.opencover.xml"
6760
dotnet build
68-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
61+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)