Skip to content

Commit dd1d4c0

Browse files
committed
feat: update MacOS build workflow to include coverage analysis and streamline SonarCloud integration
1 parent 4540a34 commit dd1d4c0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ jobs:
6565
- name: Enforce SDK Version
6666
run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force
6767

68-
- name: pre_build
68+
- name: build and analyze
6969
if: matrix.platform.name == 'MacOS'
70-
run: ./.sonar/scanner/dotnet-sonarscanner begin /k:"magic5644_codeLineCounter" /o:"magic5644" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
70+
run: |
71+
dotnet restore
72+
./.sonar/scanner/dotnet-sonarscanner begin /k:"magic5644_codeLineCounter" /o:"magic5644" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
73+
dotnet build --no-incremental
74+
dotnet-coverage collect 'dotnet test --no-build' -f xml -o 'coverage.xml'
75+
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
7176
7277
- name: Build
7378
run: dotnet build -c Release
@@ -80,12 +85,8 @@ jobs:
8085
dotnet tool install --global dotnet-reportgenerator-globaltool
8186
reportgenerator -reports:test-result.cobertura.xml -targetdir:coverage-report -reporttypes:"Html;JsonSummary;MarkdownSummaryGithub;Badges"
8287
cat coverage-report/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
83-
84-
- name: post_build
85-
if: matrix.platform.name == 'MacOS'
86-
run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
8788
88-
- name: ReportGenerator
89+
- name: ReportGenerator_CoverageReport
8990
if: matrix.platform.name == 'MacOS'
9091
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.11
9192
with:

0 commit comments

Comments
 (0)