Skip to content

Commit

Permalink
ci: update build workflow to install Coverlet and adjust SonarCloud r…
Browse files Browse the repository at this point in the history
…eport paths
  • Loading branch information
raffreitas committed Dec 20, 2024
1 parent cd82319 commit bedd558
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
distribution: "zulu"
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -42,13 +42,31 @@ jobs:
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Install Coverlet
shell: powershell
run: |
dotnet tool install --global coverlet.console
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"raffreitas_my-recipes" /o:"raffreitas-1" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=tests\**\*.Tests\coverage.opencover.xml /d:sonar.scanner.scanAll=false
.\.sonar\scanner\dotnet-sonarscanner begin
/k:"raffreitas_my-recipes"
/o:"raffreitas-1"
/d:sonar.token="${{ secrets.SONAR_TOKEN }}"
/d:sonar.host.url="https://sonarcloud.io"
/d:sonar.cs.opencover.reportsPaths=coverage.xml
/d:sonar.scanner.scanAll=false
dotnet build
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover -l trx
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
coverlet .\CovExample.Tests\bin\Debug\net6.0\CovExample.Tests.dll
--target "dotnet"
--targetargs "test --no-build"
-f=opencover
-o="coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit bedd558

Please sign in to comment.