Skip to content

Commit b51f0dd

Browse files
committed
split MySQL/Mariadb into another file
1 parent 59b7cbe commit b51f0dd

File tree

2 files changed

+216
-2
lines changed

2 files changed

+216
-2
lines changed

.github/workflows/dub.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ jobs:
142142
steps:
143143
- uses: actions/checkout@v2
144144

145-
- name: Install latest DMD
145+
- name: Install ${{ matrix.compiler }}
146146
uses: dlang-community/setup-dlang@v1
147147
with:
148-
compiler: dmd-latest
148+
compiler: ${{ matrix.compiler }}
149149

150150
- name: Install dependencies on Ubuntu
151151
if: startsWith(matrix.os, 'ubuntu')
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: CI
2+
3+
# MySQL Native should work with the following database versions:
4+
# mysql:8
5+
# mysql:5.7
6+
# mariadb:10
7+
8+
on:
9+
schedule:
10+
- cron: '30 7 1 * *'
11+
push:
12+
pull_request:
13+
14+
jobs:
15+
mysql8-tests:
16+
name: MySQL 8 Tests ${{ matrix.compiler }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
compiler:
21+
- dmd-latest
22+
- ldc-latest
23+
- dmd-2.096.1
24+
- dmd-2.095.1
25+
- dmd-2.094.2
26+
- dmd-2.084.1
27+
- dmd-2.083.1 ## As far back as unit-threaded seems to work
28+
- ldc-1.23.0 # eq to dmd v2.093.1
29+
- ldc-1.19.0 # eq to dmd v2.089.1
30+
31+
runs-on: ubuntu-20.04
32+
33+
services:
34+
mysql:
35+
image: mysql:8
36+
ports: [3306]
37+
env:
38+
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ
39+
MYSQL_DATABASE: testdb
40+
MYSQL_USER: testuser
41+
MYSQL_PASSWORD: passw0rd
42+
# Set health checks to wait until mysql service has started
43+
options: >-
44+
--health-cmd "mysqladmin ping"
45+
--health-interval 10s
46+
--health-timeout 3s
47+
--health-retries 4
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Install ${{ matrix.compiler }}
53+
uses: dlang-community/setup-dlang@v1
54+
with:
55+
compiler: ${{ matrix.compiler }}
56+
57+
- name: Install dependencies on Ubuntu
58+
if: startsWith(matrix.os, 'ubuntu')
59+
run: sudo apt-get update && sudo apt-get install libevent-dev -y
60+
61+
## Turns out the unittest-vibe-ut tried to connect to an actualy MySQL on 172.18.0.1 so it's not
62+
## actually a unit test at all. It's an integration test and should be pulled out from the main
63+
## codebase into a separate sub module
64+
- name: Run unittest-vibe-ut
65+
env:
66+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
67+
run: |
68+
echo "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb" > testConnectionStr.txt
69+
dub run -c unittest-vibe-ut -- -t
70+
71+
- name: Build The Example Project
72+
working-directory: ./examples/homePage
73+
run: dub build
74+
75+
- name: Run Example (MySQL 8)
76+
working-directory: ./examples/homePage
77+
env:
78+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
79+
run: |
80+
./example "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb"
81+
82+
mysql57-tests:
83+
name: MySQL 5.7 Tests ${{ matrix.compiler }}
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
compiler:
88+
- dmd-latest
89+
- ldc-latest
90+
- dmd-2.096.1
91+
- dmd-2.095.1
92+
- dmd-2.094.2
93+
- dmd-2.084.1
94+
- dmd-2.083.1 ## As far back as unit-threaded seems to work
95+
- ldc-1.23.0 # eq to dmd v2.093.1
96+
- ldc-1.19.0 # eq to dmd v2.089.1
97+
98+
runs-on: ubuntu-20.04
99+
100+
services:
101+
mysql:
102+
image: mysql:5.7
103+
ports: [3306]
104+
env:
105+
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ
106+
MYSQL_DATABASE: testdb
107+
MYSQL_USER: testuser
108+
MYSQL_PASSWORD: passw0rd
109+
# Set health checks to wait until mysql service has started
110+
options: >-
111+
--health-cmd "mysqladmin ping"
112+
--health-interval 10s
113+
--health-timeout 3s
114+
--health-retries 4
115+
116+
steps:
117+
- uses: actions/checkout@v2
118+
119+
- name: Install ${{ matrix.compiler }}
120+
uses: dlang-community/setup-dlang@v1
121+
with:
122+
compiler: ${{ matrix.compiler }}
123+
124+
- name: Install dependencies on Ubuntu
125+
if: startsWith(matrix.os, 'ubuntu')
126+
run: sudo apt-get update && sudo apt-get install libevent-dev -y
127+
128+
## Turns out the unittest-vibe-ut tried to connect to an actualy MySQL on 172.18.0.1 so it's not
129+
## actually a unit test at all. It's an integration test and should be pulled out from the main
130+
## codebase into a separate sub module
131+
- name: Run unittest-vibe-ut
132+
env:
133+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
134+
run: |
135+
echo "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb" > testConnectionStr.txt
136+
dub run -c unittest-vibe-ut -- -t
137+
138+
- name: Build The Example Project
139+
working-directory: ./examples/homePage
140+
run: dub build
141+
142+
- name: Run Example (MySQL 5.7)
143+
working-directory: ./examples/homePage
144+
env:
145+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
146+
run: |
147+
./example "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb"
148+
149+
mariadb10-tests:
150+
name: MariaDB 10 Tests ${{ matrix.compiler }}
151+
strategy:
152+
fail-fast: false
153+
matrix:
154+
compiler:
155+
- dmd-latest
156+
- ldc-latest
157+
- dmd-2.096.1
158+
- dmd-2.095.1
159+
- dmd-2.094.2
160+
- dmd-2.084.1
161+
- dmd-2.083.1 ## As far back as unit-threaded seems to work
162+
- ldc-1.23.0 # eq to dmd v2.093.1
163+
- ldc-1.19.0 # eq to dmd v2.089.1
164+
165+
runs-on: ubuntu-20.04
166+
167+
services:
168+
mysql:
169+
image: mariadb:10
170+
ports: [3306]
171+
env:
172+
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ
173+
MYSQL_DATABASE: testdb
174+
MYSQL_USER: testuser
175+
MYSQL_PASSWORD: passw0rd
176+
# Set health checks to wait until mysql service has started
177+
options: >-
178+
--health-cmd "mysqladmin ping"
179+
--health-interval 10s
180+
--health-timeout 3s
181+
--health-retries 4
182+
183+
steps:
184+
- uses: actions/checkout@v2
185+
186+
- name: Install ${{ matrix.compiler }}
187+
uses: dlang-community/setup-dlang@v1
188+
with:
189+
compiler: ${{ matrix.compiler }}
190+
191+
- name: Install dependencies on Ubuntu
192+
if: startsWith(matrix.os, 'ubuntu')
193+
run: sudo apt-get update && sudo apt-get install libevent-dev -y
194+
195+
## Turns out the unittest-vibe-ut tried to connect to an actualy MySQL on 172.18.0.1 so it's not
196+
## actually a unit test at all. It's an integration test and should be pulled out from the main
197+
## codebase into a separate sub module
198+
- name: Run unittest-vibe-ut
199+
env:
200+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
201+
run: |
202+
echo "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb" > testConnectionStr.txt
203+
dub run -c unittest-vibe-ut -- -t
204+
205+
- name: Build The Example Project
206+
working-directory: ./examples/homePage
207+
run: dub build
208+
209+
- name: Run Example (mariadb 10)
210+
working-directory: ./examples/homePage
211+
env:
212+
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
213+
run: |
214+
./example "host=localhost;port=$MYSQL_PORT;user=testuser;pwd=passw0rd;db=testdb"

0 commit comments

Comments
 (0)