-
Notifications
You must be signed in to change notification settings - Fork 16
53 lines (45 loc) · 1.29 KB
/
CSharp.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
name: Test CSharp
on:
push:
paths:
- 'CSharp/**'
- '.github/workflows/CSharp.yml'
pull_request:
paths:
- 'CSharp/**'
- '.github/workflows/CSharp.yml'
jobs:
build:
runs-on: windows-latest
env:
DB_USER: root
DB_OLD_PASSWORD:
DB_PASSWORD: mysql
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Start MYSQL
uses: shogo82148/[email protected]
with:
mysql-version: "8.0"
- name: Configure MYSQL and import DB
run: |
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} password ${{ env.DB_PASSWORD }}
type .\build\Database\initDatabase.sql | mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Setup up CSharp
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Cache Nuget packages
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Build and test
working-directory: CSharp
run: |
dotnet restore
dotnet build
dotnet test -v n --filter "ShouldGreet|Test1|Test2|Test3|Test4|GetDistance"