@@ -20,43 +20,35 @@ jobs:
2020 back-end-tests :
2121 runs-on : ubuntu-latest
2222 steps :
23- - name : Checkout
24- uses : actions/checkout@v2
23+ - name : Set up JDK 17
24+ uses : actions/setup-java@v4
25+ with :
26+ java-version : 17
27+ distribution : ' zulu'
2528
2629 - name : Setup .NET
2730 uses : actions/setup-dotnet@v1
2831 with :
2932 dotnet-version : 9.x
3033
31- - name : Restore Dependencies
32- run : dotnet restore
33-
34- - name : Build
35- run : dotnet build --configuration Release --no-restore
36-
37- - name : Test
38- run : dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --results-directory ./coverage
34+ - name : Install SonarQube Cloud scanner
35+ run : |
36+ dotnet tool install --global dotnet-sonarscanner
3937
40- - name : Back End Code Coverage Report
41- uses : irongut/CodeCoverageSummary@v1.3.0
42- with :
43- filename : coverage/**/coverage.cobertura.xml
44- badge : true
45- fail_below_min : true
46- format : markdown
47- hide_branch_rate : false
48- hide_complexity : true
49- indicators : true
50- output : both
51- thresholds : ' 0 80'
52-
53- - name : Add Coverage PR Comment
54- uses : marocchino/sticky-pull-request-comment@v2
55- if : github.event_name == 'pull_request'
38+ - name : Checkout code
39+ uses : actions/checkout@v4
5640 with :
57- header : Back End Coverage
58- recreate : true
59- path : code-coverage-results.md
41+ fetch-depth : 0
42+
43+ - name : Build, Test, and Analyze
44+ env :
45+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
46+ run : |
47+ dotnet-sonarscanner begin /k:"mlapaglia_OpenAlprWebhookProcessor" /o:"openalprwebhookprocessor" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml"
48+ dotnet restore
49+ dotnet build --configuration Release --no-restore
50+ dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage;Format=opencover" --results-directory ./coverage
51+ dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
6052
6153 front-end-lint :
6254 runs-on : ubuntu-latest
0 commit comments