-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.83 KB
/
dotnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on: [push]
jobs:
build:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- "5432:5432"
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Load database schema
run: PGPASSWORD=postgres psql -h localhost -U postgres -d test -f db/schema.sql
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --nologo --no-build /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=\"json,lcov,cobertura\" /p:CoverletOutput=./coverage/ /p:Exclude="[*]Intech.Invoice.Test.*%2c[*]*Fake*"
env:
PG_HOST: localhost
PG_USER: postgres
PG_PASSWORD: postgres
PG_DATABASE: test
- name: Code Coverage Summary
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
format: markdown
output: both
- name: Sticky Pull Request Comment
uses: marocchino/sticky-pull-request-comment@v2.5.0
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
with:
format: lcov
file: coverage/coverage.info