-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (118 loc) · 4.42 KB
/
Copy pathci.yml
File metadata and controls
142 lines (118 loc) · 4.42 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
tests-gcc:
runs-on: ubuntu-latest
env:
DS_MYSQL_TEST_HOST: 127.0.0.1
DS_MYSQL_TEST_PORT: 3306
DS_MYSQL_TEST_DATABASE: ds_mysql_test
DS_MYSQL_TEST_USER: ds_mysql_test_user
DS_MYSQL_TEST_PASSWORD: ds_mysql_test_password
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ds_mysql_test
MYSQL_USER: ds_mysql_test_user
MYSQL_PASSWORD: ds_mysql_test_password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 --protocol=tcp"
--health-interval=5s
--health-timeout=10s
--health-retries=10
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y software-properties-common ca-certificates gpg wget mysql-client
# Kitware APT repo for CMake 3.31+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' \
| sudo tee /etc/apt/sources.list.d/kitware.list
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -q
sudo apt-get install -y cmake ninja-build g++-15 \
libmysqlclient-dev pkg-config
- name: Configure
run: cmake --preset release -DSKIP_DOCKER_MANAGEMENT=ON
env:
CXX: g++-15
CC: gcc-15
- name: Build
run: cmake --build build -j4
- name: Unit tests
run: ctest --preset release -R tests_unit_ds_mysql
- name: Initialize database
run: |
mysql -h 127.0.0.1 -P 3306 -u root -proot \
< tests/integration/docker/init-db.sql
- name: Integration tests
run: ctest --preset release -R tests_integration_ds_mysql
tests-clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y software-properties-common ca-certificates gpg wget
# Kitware APT repo for CMake 3.31+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' \
| sudo tee /etc/apt/sources.list.d/kitware.list
sudo apt-get update -q
sudo apt-get install -y cmake ninja-build clang-20 \
libmysqlclient-dev pkg-config
- name: Configure
run: cmake --preset release -DSKIP_DOCKER_MANAGEMENT=ON -DBUILD_INTEGRATION_TESTS=OFF -DBUILD_EXAMPLES=OFF
env:
CXX: clang++-20
CC: clang-20
- name: Build
run: cmake --build build -j4
- name: Unit tests
run: ctest --preset release -R tests_unit_ds_mysql
tests-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
choco install cmake ninja --no-progress -y
shell: pwsh
- name: Detect MySQL root
shell: pwsh
run: |
$dirs = Get-ChildItem "C:\Program Files\MySQL" -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -like "MySQL Server *" } |
Sort-Object Name -Descending
if (-not $dirs) { throw "MySQL installation not found" }
$root = $dirs[0].FullName
echo "MYSQL_ROOT_DIR=$root" >> $env:GITHUB_ENV
echo "$root\lib" >> $env:GITHUB_PATH
- name: Configure
shell: pwsh
run: |
cmake -B build `
-G "Visual Studio 17 2022" -A x64 `
-DBUILD_INTEGRATION_TESTS=OFF `
-DBUILD_EXAMPLES=OFF `
"-DMYSQL_ROOT_DIR=$env:MYSQL_ROOT_DIR"
- name: Build
run: cmake --build build --config Release -j4
- name: Unit tests
run: ctest --test-dir build -C Release -R tests_unit_ds_mysql --output-on-failure