-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (43 loc) · 1.91 KB
/
sonarcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: SonarCloud
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=bravecobra
-Dsonar.projectKey=bravecobra_k8s-dev-infrastructure
-Dsonar.sources=src/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarScanner for .NET 6 with pull request decoration support
uses: highbyte/sonarscan-dotnet@v2.2.2
with:
# The key of the SonarQube project
sonarProjectKey: bravecobra_k8s-dev-infrastructure_dotnet
# The name of the SonarQube project
sonarProjectName: k8s-dev-infrastructure_dotnet
# The name of the SonarQube organization in SonarCloud. For hosted SonarQube, skip this setting.
sonarOrganization: bravecobra
dotnetBuildArguments: ./src/samples/TelemetrySamples/
dotnetDisableTests: true
## Optional command arguments to dotnet test
# dotnetTestArguments: ./src --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
## Optional extra command arguments the the SonarScanner 'begin' command
# sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_DOTNET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}