Skip to content

Commit 77a217e

Browse files
authored
Update sonarcloud.yml
1 parent a8c55e8 commit 77a217e

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/sonarcloud.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,26 @@ jobs:
6666
/d:sonar.qualitygate.wait=true
6767
shell: pwsh
6868
# 2) BUILD & TEST
69-
- name: Restore
69+
- name: Restore
7070
run: dotnet restore NetSdrClient.sln
7171
- name: Build
7272
run: dotnet build NetSdrClient.sln -c Release --no-restore
73-
- name: Tests with coverage (OpenCover)
74-
run: |
75-
dotnet test NetSdrClientAppTests/NetSdrClientAppTests.csproj -c Release --no-build `
76-
/p:CollectCoverage=true `
77-
/p:CoverletOutput=TestResults/coverage.xml `
78-
/p:CoverletOutputFormat=opencover
79-
shell: pwsh
73+
#coverage
74+
- name: Test with coverage
75+
run: |
76+
dotnet test NetSdrClient.Tests/NetSdrClient.Tests.csproj -c Release \
77+
--logger "trx;LogFileName=test-results.trx" \
78+
/p:CollectCoverage=true \
79+
/p:CoverletOutput=TestResults/ \
80+
/p:CoverletOutputFormat=opencover \
81+
/p:Exclude="[nunit.*]*%2c[*.Tests]*%2c[Moq]*%2c[NUnit.*]*"
82+
83+
- name: Upload test results
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: test-coverage-results
87+
path: NetSdrClient.Tests/TestResults/
88+
retention-days: 30
8089
# 3) END: SonarScanner
8190
- name: SonarScanner End
8291
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)