-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (64 loc) · 2.35 KB
/
deep-source.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deep Source
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup MSBuild Path
uses: microsoft/setup-msbuild@v1.3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Setup Nuget
uses: NuGet/setup-nuget@v1.2
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1.2
- name: DotNet Tool Install Coverlet
run: dotnet tool install --global coverlet.console
- name: Set solution name
run: |
echo "solution=$([io.path]::GetFileNameWithoutExtension($(Get-ChildItem -Path .\* -Include *.sln)))" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Restore NuGet Packages
run: nuget restore ${{ env.solution }}.sln
- name: Build Release
run: msbuild ${{ env.solution }}.sln /p:Configuration=Release
- name: Test
run: coverlet Tests\${{ env.solution }}.Tests\bin\Release\${{ env.solution }}.Tests.dll -t "vstest.console.exe" -a "Tests\${{ env.solution }}.Tests\bin\Release\${{ env.solution }}.Tests.dll" -o "Tests\${{ env.solution }}.Tests\bin\Release\\" -f cobertura
- name: Upload artifact test coverage
uses: actions/upload-artifact@v3.1.3
with:
name: coverage
path: Tests\${{ env.solution }}.Tests\bin\Release\coverage.cobertura.xml
deep-source:
name: Deep Source Coverage report
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Download artifact test coverage
uses: actions/download-artifact@v3
with:
name: coverage
- name: Install DeepSource scanner
run: curl https://deepsource.io/cli | sh
- name: Analyze
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: ./bin/deepsource report --analyzer test-coverage --key csharp --value-file coverage.cobertura.xml