forked from otland/forgottenserver
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (38 loc) · 1.35 KB
/
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
45
46
47
48
49
name: Unit tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: mariadb
env:
MARIADB_USER: forgottenserver
MARIADB_PASSWORD: forgottenserver
MARIADB_DATABASE: forgottenserver
MARIADB_INITDB_SKIP_TZINFO: "yes"
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Get latest CMake
# Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
- name: Setup database
run: |
sudo apt update -qq
sudo apt install -yqq mariadb-client
mysql -h 0.0.0.0 -u forgottenserver -pforgottenserver forgottenserver < schema.sql
- name: Build with CMake
uses: lukka/run-cmake@v10
with:
buildPreset: vcpkg
buildPresetAdditionalArgs: "['--config', 'Debug']"
configurePreset: vcpkg
configurePresetAdditionalArgs: "['-DBUILD_TESTING=ON']"
testPreset: vcpkg
testPresetAdditionalArgs: "['--build-config', 'Debug', '--output-on-failure']"