-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (51 loc) · 1.62 KB
/
unit-tests.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
# This workflow will install Python dependencies, run pre-commit checks, and run tests with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit tests
on:
workflow_call:
push:
branches: [ main, 0.x ]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up .NET 6.0
id: dotnet-setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0
- name: use .NET 6.0
run: |
dotnet new globaljson --sdk-version '${{ steps.dotnet-setup.outputs.dotnet-version }}'
- name: Install dependencies
run: |
dotnet restore
- name: Run unit tests
run: |
dotnet test --filter "Category!=Integration" /p:AltCover=true
- name: Save coverage report
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: /home/runner/work/firebolt-net-sdk/firebolt-net-sdk/FireboltDotNetSdk.Tests/coverage.xml
coverage:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: coverage.xml
- name: Fix file paths
run: |
sed -i -e "s/\/home\/runner\/work\/firebolt-net-sdk\/firebolt-net-sdk\///g" coverage.xml
- name: Report
uses: 5monkeys/cobertura-action@v13
with:
minimum_coverage: 80
fail_below_threshold: true
show_class_names: true
show_missing: true
link_missing_lines: true
only_changed_files: true