File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 77 push :
88 branches :
99 - main
10+ pull_request :
11+ types : [opened, synchronize, reopened]
1012 # workflow_dispatch:
1113
1214jobs :
15+ sonar :
16+ name : SonarQube Analysis
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
22+
23+ - uses : ./.github/actions/setup-dotnet
24+
25+ - name : Cache SonarQube packages
26+ uses : actions/cache@v4
27+ with :
28+ path : ~/.sonar/cache
29+ key : ${{ runner.os }}-sonar
30+ restore-keys : ${{ runner.os }}-sonar
31+
32+ - name : Cache SonarQube scanner
33+ id : cache-sonar-scanner
34+ uses : actions/cache@v4
35+ with :
36+ path : ./.sonar/scanner
37+ key : ${{ runner.os }}-sonar-scanner
38+ restore-keys : ${{ runner.os }}-sonar-scanner
39+
40+ - name : Install SonarQube scanner
41+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
42+ run : |
43+ mkdir -p ./.sonar/scanner
44+ dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
45+
46+ - name : Run SonarQube analysis
47+ env :
48+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
49+ run : |
50+ ./.sonar/scanner/dotnet-sonarscanner begin /k:"PathfinderHonorManager_PathfinderHonorManagerAPI" /o:"pathfinderhonormanager" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
51+ dotnet build
52+ ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
53+
1354 test :
1455 name : Test
56+ needs : sonar
1557 runs-on : ubuntu-latest
1658
1759 steps :
2769 with :
2870 name : coverage-report
2971 path : TestResults
72+
73+ - name : Publish Code Coverage
74+ uses : codecov/codecov-action@v4
75+ with :
76+ files : TestResults/**/*.coverage.xml
77+ fail_ci_if_error : false
3078
3179 analyze :
3280 name : Analyze
81+ needs : test
3382 runs-on : ubuntu-latest
3483 permissions :
3584 actions : read
You can’t perform that action at this time.
0 commit comments