-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.53 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
name: Capture.The.Flag
on:
push:
branches:
- dev
pull_request:
branches:
- dev
env:
DOTNET_VERSION: '8.x'
jobs:
unit_testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Execute unit tests
run: dotnet test ./tests/Application.Tests/CTF.Application.Tests.csproj -c Release
integration_testing:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb
ports:
- 3306:3306
env:
MARIADB_DATABASE: gamemode
MARIADB_ROOT_PASSWORD: 123456789
options: --name mariadb
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check sqlite3 version
run: sqlite3 --version
- name: Waiting for database availability
run: |
chmod u+x wait-for-it.sh
./wait-for-it.sh -t 60 127.0.0.1:3306
- name: Import databases
run: |
docker exec -i mariadb mariadb -uroot -p123456789 -h127.0.0.1 gamemode < ./scripts/mariadb/gamemode.sql
sqlite3 gamemode.db < ./scripts/sqlite/gamemode.sql
- name: Create .env.test file
run: cp ./tests/Persistence.Tests/.env.test.example ./tests/Persistence.Tests/.env.test
- name: Execute integration tests
run: dotnet test ./tests/Persistence.Tests/Persistence.Tests.csproj -c Release