-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
115 lines (110 loc) · 3.54 KB
/
db_ci.yml
File metadata and controls
115 lines (110 loc) · 3.54 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
name: Database CI
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- '**.yml'
- '!**/db_ci.yml'
- 'examples/**'
- 'doc/**'
pull_request:
paths-ignore:
- '**.md'
- '**.yml'
- '!**/db_ci.yml'
- 'examples/**'
- 'doc/**'
concurrency:
group: db-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
mysql-driver-tests:
runs-on: ubuntu-24.04
timeout-minutes: 30
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: 12345678
MYSQL_ROOT_HOST: '%'
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -p12345678"
--health-interval=10s
--health-timeout=5s
--health-retries=24
steps:
- uses: actions/checkout@v6
- name: Build V
run: make -j4 && ./v symlink
- name: Install mysql client headers
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y libmariadb-dev
- name: Run mysql driver tests
run: ./v -d network -d started_mysqld -silent test vlib/db/mysql/
postgres-driver-tests:
runs-on: ubuntu-24.04
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: 12345678
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres -d postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=24
steps:
- uses: actions/checkout@v6
- name: Build V
run: make -j4 && ./v symlink
- name: Install postgres client headers
run: |
.github/workflows/disable_azure_mirror.sh
./v retry -- sudo apt update
./v retry -- sudo apt install --quiet -y libpq-dev
- name: Run postgres driver tests
run: ./v -d network -d started_postgres -silent test vlib/db/pg/
mssql-driver-tests:
runs-on: ubuntu-24.04
timeout-minutes: 30
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Developer
MSSQL_SA_PASSWORD: Vlang12345678!
ports:
- 1433:1433
steps:
- uses: actions/checkout@v6
- name: Build V
run: make -j4 && ./v symlink
- name: Install ODBC dependencies
run: |
.github/workflows/disable_azure_mirror.sh
[ -f /usr/share/keyrings/microsoft-prod.gpg ] || curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --batch --no-tty --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
curl -fsSL https://packages.microsoft.com/config/ubuntu/24.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
./v retry -- sudo apt update
sudo ACCEPT_EULA=Y apt install --quiet -y msodbcsql18 unixodbc-dev
- name: Wait for sql server
run: |
for _ in $(seq 1 60); do
if (echo > /dev/tcp/127.0.0.1/1433) >/dev/null 2>&1; then
exit 0
fi
sleep 2
done
exit 1
- name: Run mssql driver tests
env:
VMSSQL_CONN_STR: 'Driver={ODBC Driver 18 for SQL Server};Server=127.0.0.1;Port=1433;UID=sa;PWD=Vlang12345678!;Database=master;TrustServerCertificate=yes'
run: ./v -d network -d started_mssql -silent test vlib/db/mssql/