-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 2.07 KB
/
dotnet-test.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
85
86
87
88
89
90
name: .NET Core Build
on:
push:
branches: [ master ]
paths-ignore:
- 'Examples/**'
- 'README**'
pull_request:
branches: [ master ]
types: [ opened, synchronize ]
paths-ignore:
- 'Examples/**'
- 'README**'
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
NUGET_XMLDOC_MODE: skip
NUGET_PACKAGE_PATH: ${{ github.workspace }}/.nuget/packages
jobs:
lint:
name: Lint Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1
- name: Restore Tools
run: |
dotnet tool restore
dotnet tool install -g dotnet-format
- name: Add Problem Matcher for dotnet-format
uses: xt0rted/dotnet-format-problem-matcher@v1
- name: Lint
run: dotnet format --check
build:
name: Test .NET Side by Side
runs-on: windows-latest
env:
config: 'Release'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
# Setup package cache
- uses: actions/cache@v2
with:
path: ${{ env.NUGET_PACKAGE_PATH }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
# Setup .NET frameworks
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0'
- name: Setup NuGet
uses: nuget/setup-nuget@v1
# Install dependencies
- name: NuGet Restore
run: nuget restore ZotapaySDK.sln
# Build project
- name: Build
run: dotnet build --configuration ${{env.config}} --no-restore
# run tests with built project
- name: Test
run: |
dotnet test --framework net8.0 --no-restore --no-build --configuration ${{env.config}} --settings coverlet.runsettings
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: "!**/.nuget/packages/**/*.*"