diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 4781201..d691e37 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -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/sonarscan-dotnet@v2.2.1 - 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 }}