-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (49 loc) · 1.8 KB
/
ci.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
name: "CI"
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
build:
name: 'Build'
runs-on: 'ubuntu-latest'
services:
azurite:
image: mcr.microsoft.com/azure-storage/azurite:latest
ports:
- 10000:10000
- 10001:10001
- 10002:10002
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 1433:1433
env:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: 'SpecFlowLocalDbPassword85!'
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Install dotnet'
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: 'Restore packages'
run: dotnet restore
- name: 'Build project'
run: dotnet build --no-restore --configuration Debug
- name: Test
run: dotnet test --no-restore --configuration Debug --logger "trx;LogFileName=test-results.trx" --blame --blame-crash --blame-hang --blame-hang-timeout 10m --settings "./Ark.ReferenceProject/CodeCoverage.runsettings" --collect "Code Coverage;Format=cobertura"
# see https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
- uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: "**/test-results.trx"
- name: Create code coverage report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:**/*.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura'
- name: Write to Job Summary
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY