File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : SonarCLoud Analysis
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ pull_request :
7
+ branches : [main]
8
+ types : [opened, synchronize, reopened]
9
+
10
+ jobs :
11
+ build :
12
+ runs-on : ubuntu-latest
13
+
14
+ 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
+ run : dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
39
+
40
+ - name : Build and analyze
41
+ env :
42
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
43
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
44
+ run : |
45
+ ./.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"
46
+ dotnet restore
47
+ dotnet build --no-restore
48
+ ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
You can’t perform that action at this time.
0 commit comments