-
Notifications
You must be signed in to change notification settings - Fork 14
72 lines (65 loc) · 2.07 KB
/
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
66
67
68
69
70
71
72
name: "Paprika Tests"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
BUILD_CONFIG: release
DOTNET_VERSION: 8
DOTNET_INSTALL_DIR: "~/.dotnet"
jobs:
tests:
timeout-minutes: 20
name: "Run Paprika tests"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # for sticky-pull-request-comment
steps:
- name: Cache dotnet
id: cache-dotnet
uses: actions/cache@v3
with:
path: ${{ env.DOTNET_INSTALL_DIR }}
key: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }}
restore-keys: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }}
- name: Set up .NET
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache nuget
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
- name: Test
run: dotnet test src/Paprika.Tests -c ${{ env.BUILD_CONFIG }} --filter TestCategory\!~LongRunning --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "75 85"
- name: Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
header: Code Coverage
recreate: true
path: code-coverage-results.md