generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (45 loc) · 1.75 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
61
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Pull SqlServer
run: docker pull mcr.microsoft.com/mssql/server
- name: Start SqlServer
run: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" --name sqlserver -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- name: Enable SqlServer Agent (required for CDC)
run: docker exec -u root sqlserver bash /opt/mssql/bin/mssql-conf set sqlagent.enabled true
- name: Restart SqlServer
run: docker container restart sqlserver
- name: Sleep (allow SqlServer to complete startup)
run: sleep 10
- name: Set EnvVar for Test
run: echo "SqlServerDemo_ConnectionStrings__SqlDb=Data Source=localhost, 1433;Initial Catalog=NTangleDemo;User id=sa;Password=yourStrong(!)Password;TrustServerCertificate=true" >> $GITHUB_ENV
- name: Test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./coverage/lcov.info --no-build --verbosity normal
- name: Merge Code Coverage
run: |
mkdir ./coverage
npx lcov-result-merger '**/lcov.info' './coverage/lcov.info'
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./samples/SqlServerDemo/SqlServerDemo.Test/coverage/lcov.info