Skip to content

Commit

Permalink
Update sonarcloud.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelschlatter authored Nov 3, 2023
1 parent a0ee518 commit 47861cd
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,14 @@
name: Sonarcloud

env:
COVERAGE_FOLDER: Coverage
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
push:
branches:
- '**'

jobs:
ci:
name: Code Coverage
runs-on: ubuntu-latest
outputs:
should-publish: ${{ steps.context.outputs.should-publish }}
current-version: ${{ steps.context.outputs.current-version }}
release-type: ${{ steps.context.outputs.release-type }}
cascading-release: ${{ steps.context.outputs.cascading-release }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install dependencies
run: dotnet restore --no-cache --verbosity normal
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test and report coverage
run: dotnet test --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=${{ github.workspace }}/${{ env.COVERAGE_FOLDER }}/ /p:MergeWith=${{ github.workspace }}/${{ env.COVERAGE_FOLDER }}/coverage/ /p:CoverletOutputFormat=opencover

- name: SonarScanner for .NET Core with pull request decoration support
uses: highbyte/[email protected]
with:
sonarProjectKey: RaaLabs_${{ github.event.repository.name }}
sonarProjectName: ${{ github.event.repository.name }}
sonarOrganization: raalabs
dotnetTestArguments: --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
sonarcloud:
uses: RaaLabs/reusable-workflows/.github/workflows/dotnet-sonarcloud.yml@main
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
NUGET_GITHUB_PACKAGES_TOKEN: ${{ secrets.NUGET_GITHUB_PACKAGES_TOKEN }}
NUGET_GITHUB_PACKAGES_USERNAME: ${{ secrets.NUGET_GITHUB_PACKAGES_USERNAME }}

0 comments on commit 47861cd

Please sign in to comment.