|
16 | 16 | - 'Assets/**'
|
17 | 17 | - '**/assets/**'
|
18 | 18 | - '.github/**'
|
19 |
| - |
20 | 19 | jobs:
|
21 | 20 | build:
|
22 |
| - |
| 21 | + name: Build and analyze |
23 | 22 | runs-on: windows-latest
|
24 |
| - |
25 | 23 | steps:
|
26 | 24 | - name: Set up JDK 11
|
27 |
| - uses: actions/setup-java@v1 |
| 25 | + uses: actions/setup-java@v3 |
28 | 26 | 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 |
32 | 30 | with:
|
33 | 31 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
34 |
| - |
35 | 32 | - name: Cache SonarCloud packages
|
36 |
| - uses: actions/cache@v1 |
| 33 | + uses: actions/cache@v3 |
37 | 34 | with:
|
38 | 35 | path: ~\sonar\cache
|
39 | 36 | key: ${{ runner.os }}-sonar
|
40 | 37 | restore-keys: ${{ runner.os }}-sonar
|
41 |
| - |
42 | 38 | - name: Cache SonarCloud scanner
|
43 | 39 | id: cache-sonar-scanner
|
44 |
| - uses: actions/cache@v1 |
| 40 | + uses: actions/cache@v3 |
45 | 41 | with:
|
46 | 42 | path: .\.sonar\scanner
|
47 | 43 | key: ${{ runner.os }}-sonar-scanner
|
48 | 44 | restore-keys: ${{ runner.os }}-sonar-scanner
|
49 |
| - |
50 | 45 | - name: Install SonarCloud scanner
|
51 | 46 | if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
52 | 47 | shell: powershell
|
53 | 48 | run: |
|
54 | 49 | New-Item -Path .\.sonar\scanner -ItemType Directory
|
55 | 50 | dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
|
56 |
| - |
57 | 51 | - name: Test
|
58 | 52 | run: dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ExcludeByFile=**/Program.cs
|
59 |
| - |
60 | 53 | - name: Build and analyze
|
61 | 54 | env:
|
62 | 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
63 | 56 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
64 | 57 | shell: powershell
|
65 | 58 | 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" |
67 | 60 | 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