Skip to content

SonarScan for PR 53 #164

SonarScan for PR 53

SonarScan for PR 53 #164

Workflow file for this run

name: Px.Utils SonarScan
run-name: SonarScan for PR ${{ github.event.pull_request.number }}
on:
pull_request:
branches:
- 'dev'
push:
branches:
- 'dev'
jobs:
sonar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Install dotnet-coverage
run: dotnet tool install -g dotnet-coverage
- name: Install SonarCloud scanner
run: dotnet tool install -g dotnet-sonarscanner
- name: Begin SonarScanner
run: dotnet sonarscanner begin /k:PxTools_Px.Utils
/o:pxtools
/d:sonar.host.url=https://sonarcloud.io
/d:sonar.token=${{ secrets.SONAR_TOKEN }}
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
/d:sonar.coverage.exclusions=Px.Utils.TestingApp/**
- name: Run coverage test
run: dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
- name: End SonarScanner
run: dotnet sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }}