-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (34 loc) · 1.27 KB
/
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
on:
push:
paths:
- "**.cs"
pull_request:
paths:
- "**.cs"
workflow_dispatch:
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Run tests
if: github.event_name == 'pull_request'
run:
dotnet test src/Serein.Tests --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
- name: Generate coverage
id: coverage
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (failure() || success())
run: |
dotnet tool install --global JetBrains.dotCover.CommandLineTools
dotnet dotcover cover-dotnet --Output=AppCoverageReport.xml --ReportType=DetailedXML -- test --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
- name: Run codacy-coverage-reporter
if: steps.coverage.conclusion != 'skipped' && (failure() || success())
uses: codacy/[email protected]
with:
api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: AppCoverageReport.xml