-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (33 loc) · 1.39 KB
/
build_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
40
41
42
43
44
name: Build & test back-end
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: 8.0.x
- name: Install dotnet-ef
run: dotnet tool install --global dotnet-ef
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Generate creation and migrations script
run: dotnet ef migrations script -i -o CreateOrMigrateDatabase.sql --project Database/Database.csproj --startup-project Api/Api.csproj --context DataContext -v
- name: Launch SQL Server in Docker, create DB & schema, set ENV variable with the connection string
run: source ./devops/start_docker_sql_server_with_new_db.sh CreateOrMigrateDatabase.sql ./devops/wait-for-it.sh
shell: bash
- name: Test
run: dotnet test --no-build --no-restore --configuration Release --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./Domain.Tests/TestResults/coverage.info