-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.74 KB
/
ci.yaml
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
name: build
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'LICENSE'
- 'README.md'
pull_request:
branches:
- main
paths-ignore:
- 'LICENSE'
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '5.0.x' ]
name: Dotnet ${{ matrix.dotnet }} build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Clean
run: dotnet clean -c Debug
- name: Build
run: dotnet build -c Debug
- uses: isbang/compose-action@v1.0.0
with:
compose-file: './docker-compose-tests.yml'
- name: Test
run: dotnet test -c Debug --no-build -l trx --verbosity=normal
- name: Calculate code coverage
run: |
dotnet new tool-manifest --force
dotnet tool install coverlet.console
DEBUG_TEST_ASSEMBLY=$(find ./tests/Tests/bin/Debug -type f -name Tests.dll | head -n 1)
echo "Debug assembly $DEBUG_TEST_ASSEMBLY"
dotnet coverlet $DEBUG_TEST_ASSEMBLY \
--target "dotnet" --targetargs "test ./tests/Tests --no-build" \
--format=opencover --use-source-link --output=opencover_coverage.xml
- name: Publish code coverage as artifacts
uses: actions/upload-artifact@v1
with:
name: CodeCoverageReport
path: ./opencover_coverage.xml
- name: Upload code coverage to Codecov
run: |
curl -s https://codecov.io/bash > codecov
chmod +x codecov
./codecov -f "opencover_coverage.xml" -t ${{ secrets.CODECOV_TOKEN }}