@@ -2,51 +2,51 @@ name: .NET
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
7+ branches : [main]
8+ types : [opened, synchronize, reopened]
89
910jobs :
1011 build :
11-
1212 runs-on : ubuntu-latest
1313
1414 steps :
15- - name : Set up JDK 11
16- uses : actions/setup-java@v1
17- with :
18- java-version : 1.11
19- - uses : actions/checkout@v2
20-
21- - name : Cache SonarCloud packages
22- uses : actions/cache@v1
23- with :
24- path : ~\sonar\cache
25- key : ${{ runner.os }}-sonar
26- restore-keys : ${{ runner.os }}-sonar
27-
28- - name : Cache SonarCloud scanner
29- id : cache-sonar-scanner
30- uses : actions/cache@v1
31- with :
32- path : .\.sonar\scanner
33- key : ${{ runner.os }}-sonar-scanner
34- restore-keys : ${{ runner.os }}-sonar-scanner
35-
36- - name : Install SonarCloud scanner
37- if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
38- shell : pwsh
39- run : |
40- New-Item -Path .\.sonar\scanner -ItemType Directory
41- dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42-
43- - name : Build and analyze
44- env :
45- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
46- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
47- shell : pwsh
48- run : |
49- .\.sonar\scanner\dotnet-sonarscanner begin /k:"notion-dotnet_notion-sdk-net" /o:"notion-dotnet" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
50- dotnet restore
51- dotnet build --no-restore
52- .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
15+ - name : Set up JDK 11
16+ uses : actions/setup-java@v1
17+ with :
18+ java-version : 1.11
19+ - uses : actions/checkout@v2
20+
21+ - name : Cache SonarCloud packages
22+ uses : actions/cache@v1
23+ with :
24+ path : ~\sonar\cache
25+ key : ${{ runner.os }}-sonar
26+ restore-keys : ${{ runner.os }}-sonar
27+
28+ - name : Cache SonarCloud scanner
29+ id : cache-sonar-scanner
30+ uses : actions/cache@v1
31+ with :
32+ path : .\.sonar\scanner
33+ key : ${{ runner.os }}-sonar-scanner
34+ restore-keys : ${{ runner.os }}-sonar-scanner
35+
36+ - name : Install SonarCloud scanner
37+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
38+ shell : pwsh
39+ run : |
40+ New-Item -Path .\.sonar\scanner -ItemType Directory
41+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42+
43+ - name : Build and analyze
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
46+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
47+ shell : pwsh
48+ run : |
49+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"notion-dotnet_notion-sdk-net" /o:"notion-dotnet" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
50+ dotnet restore
51+ dotnet build --no-restore
52+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
0 commit comments