-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (32 loc) · 1 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
name: SonarQube Cloud
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: "./global.json"
- 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_PxWebApi
/o:pxtools
/d:sonar.token=${{ secrets.SONAR_TOKEN }}
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: Build
run: dotnet build --no-incremental
- 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 }}