|
12 | 12 | workflow_dispatch: |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - # Quality checks that can run in parallel |
| 15 | + test: |
| 16 | + name: Test |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - uses: ./.github/actions/setup-dotnet |
| 21 | + - name: Build solution |
| 22 | + run: dotnet build --no-incremental |
| 23 | + - name: Test with the dotnet CLI (OpenCover) |
| 24 | + run: dotnet test PathfinderHonorManager.Tests/PathfinderHonorManager.Tests.csproj /p:CollectCoverage=true /p:CoverletOutput=TestResults/coverage.opencover.xml /p:CoverletOutputFormat=opencover /p:UseSourceLink=true |
| 25 | + - name: Upload coverage report |
| 26 | + uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: coverage-report |
| 29 | + path: PathfinderHonorManager.Tests/TestResults/coverage.opencover.xml |
| 30 | + |
16 | 31 | sonar: |
17 | 32 | name: SonarQube Analysis |
| 33 | + needs: test |
18 | 34 | runs-on: ubuntu-latest |
19 | 35 | steps: |
20 | 36 | - uses: actions/checkout@v4 |
21 | 37 | with: |
22 | 38 | fetch-depth: 0 |
23 | | - |
24 | 39 | - uses: ./.github/actions/setup-dotnet |
25 | | - |
| 40 | + - name: Download coverage report |
| 41 | + uses: actions/download-artifact@v4 |
| 42 | + with: |
| 43 | + name: coverage-report |
| 44 | + path: . |
26 | 45 | - name: Cache SonarQube packages |
27 | 46 | uses: actions/cache@v4 |
28 | 47 | with: |
29 | 48 | path: ~/.sonar/cache |
30 | 49 | key: ${{ runner.os }}-sonar |
31 | 50 | restore-keys: ${{ runner.os }}-sonar |
32 | | - |
33 | 51 | - name: Cache SonarQube scanner |
34 | 52 | id: cache-sonar-scanner |
35 | 53 | uses: actions/cache@v4 |
36 | 54 | with: |
37 | 55 | path: ./.sonar/scanner |
38 | 56 | key: ${{ runner.os }}-sonar-scanner |
39 | 57 | restore-keys: ${{ runner.os }}-sonar-scanner |
40 | | - |
41 | 58 | - name: Install SonarQube scanner |
42 | 59 | if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' |
43 | 60 | run: | |
44 | 61 | mkdir -p ./.sonar/scanner |
45 | 62 | dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner |
46 | | -
|
47 | 63 | - name: SonarQube begin analysis |
48 | 64 | env: |
49 | 65 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
50 | 66 | run: | |
51 | | - ./.sonar/scanner/dotnet-sonarscanner begin /k:"PathfinderHonorManager_PathfinderHonorManagerAPI" /o:"pathfinderhonormanager" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="PathfinderHonorManager.Tests/TestResults/coverage.opencover.xml" |
52 | | -
|
| 67 | + ./.sonar/scanner/dotnet-sonarscanner begin /k:"PathfinderHonorManager_PathfinderHonorManagerAPI" /o:"pathfinderhonormanager" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="coverage.opencover.xml" |
53 | 68 | - name: Build solution (SonarQube) |
54 | 69 | run: dotnet build --no-incremental |
55 | | - |
56 | 70 | - name: SonarQube end analysis |
57 | 71 | env: |
58 | 72 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
59 | 73 | run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |
60 | 74 |
|
61 | | - test: |
62 | | - name: Test |
63 | | - runs-on: ubuntu-latest |
64 | | - steps: |
65 | | - - uses: actions/checkout@v4 |
66 | | - |
67 | | - - uses: ./.github/actions/setup-dotnet |
68 | | - |
69 | | - - name: Build solution |
70 | | - run: dotnet build --no-incremental |
71 | | - |
72 | | - - name: Test with the dotnet CLI (OpenCover) |
73 | | - run: dotnet test PathfinderHonorManager.Tests/PathfinderHonorManager.Tests.csproj /p:CollectCoverage=true /p:CoverletOutput=TestResults/coverage.opencover.xml /p:CoverletOutputFormat=opencover |
74 | | - |
75 | | - - name: Upload coverage report |
76 | | - uses: actions/upload-artifact@v4 |
77 | | - with: |
78 | | - name: coverage-report |
79 | | - path: PathfinderHonorManager.Tests/TestResults/coverage.opencover.xml |
80 | | - |
81 | 75 | analyze: |
82 | 76 | name: Analyze |
83 | 77 | runs-on: ubuntu-latest |
|
0 commit comments