-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configurue code coverage for sonarcloud
- Loading branch information
1 parent
14db5fa
commit 1fe5c69
Showing
2 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,42 +38,41 @@ jobs: | |
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory coverage --settings tests/coverage.runsettings | ||
|
||
- name: Sonarcloud | ||
if: github.event_name != 'pull_request' || github.ref == 'refs/heads/main' | ||
uses: sonarsource/[email protected] | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: 'coverage/*/coverage.cobertura.xml' | ||
badge: true | ||
format: 'markdown' | ||
output: 'both' | ||
|
||
- name: Add Coverage PR Comment | ||
continue-on-error: true | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
- name: Write to Job Summary | ||
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | ||
|
||
sonarcloud: | ||
needs: [build] | ||
if: github.event_name != 'pull_request' || github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: SonarCloud Scan | ||
uses: sonarsource/[email protected] | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
build-docker-image: | ||
if: github.ref == 'refs/heads/main' | ||
needs: [build] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
sonar.projectKey=soat-fiap_FIAP.TechChallenge.ByteMeBurger | ||
sonar.organization=soat-fiap | ||
sonar.projectName=Byte me burger API | ||
sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml |