This file contains hidden or 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
| name: SonarCloud analysis | ||
|
Check failure on line 1 in .github/workflows/sonarcloud.yml
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| workflow_dispatch: | ||
| permissions: | ||
| pull-requests: read | ||
| jobs: | ||
| sonar-check: | ||
| name: Sonar Check | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: { fetch-depth: 0 } | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '8.0.x' | ||
| # 1) BEGIN: SonarScanner for .NET | ||
| - name: SonarScanner Begin | ||
| run: | | ||
| dotnet tool install --global dotnet-sonarscanner | ||
| echo "$env:USERPROFILE\.dotnet\tools" >> $env:GITHUB_PATH | ||
| dotnet sonarscanner begin ` | ||
| /d:sonar.projectKey="<9244264-prog_NetSdrClient>" ` | ||
| /d:sonar.organization="<9244264-prog>" ` | ||
| /d:sonar.token="${{ 26dafeaaaf706299581d4b796ba3fbb0e936c638 }}" ` | ||
| /d:sonar.cs.opencover.reportsPaths="**/coverage.xml" ` | ||
| /d:sonar.cpd.cs.minimumTokens=40 ` | ||
| /d:sonar.cpd.cs.minimumLines=5 ` | ||
| /d:sonar.exclusions=**/bin/**,**/obj/**,**/sonarcloud.yml ` | ||
| /d:sonar.qualitygate.wait=true | ||
| shell: pwsh | ||
| # 2) BUILD & TEST | ||
| - name: Restore | ||
| run: dotnet restore NetSdrClient.sln | ||
| - name: Build | ||
| run: dotnet build NetSdrClient.sln -c Release --no-restore | ||
| #- name: Tests with coverage (OpenCover) | ||
| # run: | | ||
| # dotnet test NetSdrClientAppTests/NetSdrClientAppTests.csproj -c Release --no-build ` | ||
| # /p:CollectCoverage=true ` | ||
| # /p:CoverletOutput=TestResults/coverage.xml ` | ||
| # /p:CoverletOutputFormat=opencover | ||
| # shell: pwsh | ||
| # 3) END: SonarScanner | ||
| - name: SonarScanner End | ||
| run: dotnet sonarscanner end /d:sonar.token="${{ 26dafeaaaf706299581d4b796ba3fbb0e936c638 }}" | ||
| shell: pwsh | ||