File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ pull_request :
7
+ types : [opened, synchronize, reopened]
8
+ jobs :
9
+ build :
10
+ name : Build
11
+ runs-on : windows-latest
12
+ steps :
13
+ - name : Set up JDK 11
14
+ uses : actions/setup-java@v1
15
+ with :
16
+ java-version : 1.11
17
+ - uses : actions/checkout@v2
18
+ with :
19
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
20
+ - name : Cache SonarCloud packages
21
+ uses : actions/cache@v1
22
+ with :
23
+ path : ~\sonar\cache
24
+ key : ${{ runner.os }}-sonar
25
+ restore-keys : ${{ runner.os }}-sonar
26
+ - name : Cache SonarCloud scanner
27
+ id : cache-sonar-scanner
28
+ uses : actions/cache@v1
29
+ with :
30
+ path : .\.sonar\scanner
31
+ key : ${{ runner.os }}-sonar-scanner
32
+ restore-keys : ${{ runner.os }}-sonar-scanner
33
+ - name : Install SonarCloud scanner
34
+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
35
+ shell : powershell
36
+ run : |
37
+ New-Item -Path .\.sonar\scanner -ItemType Directory
38
+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
39
+ - name : Build and analyze
40
+ env :
41
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
42
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
43
+ shell : powershell
44
+ run : |
45
+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"csharpsdk" /o:"optidevx" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
46
+ dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=D:\a\csharp-sdk\csharp-sdk\keypair.snk -c Release
47
+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
You can’t perform that action at this time.
0 commit comments