-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1001 Bytes
/
main.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
name: Build and Test
on: [push, pull_request]
env:
DB_NAME: OrderBot # TODO: Pass this into both db.sql and tests
# CONNECTION_STRING:
jobs:
build-and-test:
name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04] # No MSSQL available for 22 yet
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup DB
uses: ankane/setup-sqlserver@v1
with:
accept-eula: true
sqlserver-version: 2019
- name: Create DB
run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -e -i deploy/db.sql
- name: Create DB Tables
run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -d ${{ env.DB_NAME }} -e -i deploy/tables.sql
- name: Setup .NET
uses: actions/setup-dotnet@v2
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal