Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Use dotnet test for coverage collection, reportgenerator to output to…
Browse files Browse the repository at this point in the history
… sonarcloud
  • Loading branch information
cshnimble committed Nov 10, 2022
1 parent 74bc343 commit 27100c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
restore-keys: ${{ runner.os }}-sonar
- name: Install SonarCloud scanners
run: dotnet tool install --global dotnet-sonarscanner
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Install dotnet reportgenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Restore dependencies
run: dotnet restore
- name: Setup node.js
Expand All @@ -48,7 +48,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet-sonarscanner begin /k:"DFE-Digital_academy-transfers-api" /o:"dfe-digital" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet-sonarscanner begin /k:"DFE-Digital_academy-transfers-api" /o:"dfe-digital" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml
dotnet build -c Release --no-restore
dotnet test -c Release --no-build --verbosity normal
dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage"
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

0 comments on commit 27100c3

Please sign in to comment.