1
+ name : QI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ branches : [ "main" ]
9
+
10
+ jobs :
11
+ analysis :
12
+ runs-on : windows-latest
13
+ steps :
14
+ - uses : actions/checkout@v3
15
+ - name : Setup .NET
16
+ uses : actions/setup-dotnet@v2
17
+ with :
18
+ dotnet-version : 8.0.x
19
+ - name : Set up JDK 11
20
+ uses : actions/setup-java@v1
21
+ with :
22
+ java-version : 1.17
23
+ - name : Cache SonarCloud packages
24
+ uses : actions/cache@v1
25
+ with :
26
+ path : ~\sonar\cache
27
+ key : ${{ runner.os }}-sonar
28
+ restore-keys : ${{ runner.os }}-sonar
29
+ - name : Cache SonarCloud scanner
30
+ id : cache-sonar-scanner
31
+ uses : actions/cache@v1
32
+ with :
33
+ path : .\.sonar\scanner
34
+ key : ${{ runner.os }}-sonar-scanner
35
+ restore-keys : ${{ runner.os }}-sonar-scanner
36
+ - name : Install SonarCloud scanner
37
+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
38
+ shell : powershell
39
+ run : |
40
+ New-Item -Path .\.sonar\scanner -ItemType Directory
41
+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42
+ dotnet tool install --global dotnet-coverage
43
+ - name : Begin Analyze
44
+ env :
45
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
46
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
47
+ shell : powershell
48
+ run : |
49
+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"alexandrejulien_Peppermint.ReverseProxy" /o:"alexandrejulien" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
50
+ - name : Restore dependencies
51
+ run : dotnet restore ./Peppermint.ReverseProxy.sln
52
+ - name : Build
53
+ run : dotnet build ./Peppermint.ReverseProxy.sln --no-restore --configuration Debug
54
+ - name : Test
55
+ shell : powershell
56
+ run : |
57
+ dotnet tool install --global dotnet-coverage
58
+ dotnet-coverage collect 'dotnet test Peppermint.ReverseProxy.sln' -f xml -o 'coverage.xml'
59
+ - name : End Analyze
60
+ env :
61
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
63
+ shell : powershell
64
+ run : |
65
+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
0 commit comments