-
Notifications
You must be signed in to change notification settings - Fork 22
43 lines (38 loc) · 1.37 KB
/
sonar.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: [ main, dev ]
pull_request:
branches: [ main, dev ]
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
java-package: jdk # optional (jdk or jre) - defaults to jdk
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup .Net SDK (v8.0)
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install dotnet global tools
run: |
dotnet tool install --global dotnet-coverage
dotnet tool install --global dotnet-sonarscanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin /k:"GeneGenie.Gedcom" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build --no-incremental
dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
dotnet sonarscanner end