-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (57 loc) · 1.75 KB
/
solution-code-coverage.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Solution code coverage
on:
workflow_dispatch:
push:
branches:
- main
paths:
- src/Services/**
pull_request:
types: [opened, synchronize, reopened]
paths:
- src/Services/**
defaults:
run:
working-directory: src
jobs:
# Builds the code
build:
name: Build
runs-on: ubuntu-latest
steps:
# Checks out the code
- name: Checkout
uses: actions/checkout@v2
# Sets up the .NET SDK
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '5.0.x'
# Installs the dependencies
- name: Install dependencies
run: dotnet restore
# Builds the code
- name: Build
run: dotnet build --no-restore --configuration "Services Build"
# Runs the tests with sonarscan
test:
needs: build
name: Test
runs-on: ubuntu-latest
steps:
# Checks out the code
- name: Checkout
uses: actions/checkout@v2
# Tests the code and performs a sonarscan
- name: Test
uses: highbyte/sonarscan-dotnet@v2.1.1-beta
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
sonarProjectKey: metalglove_Kwetter
sonarProjectName: Kwetter
sonarOrganization: metalglove-github
dotnetBuildArguments: ./src/Kwetter.sln --configuration "Services Build"
dotnetTestArguments: ./src/Kwetter.sln --configuration "Services Build" --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"