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