Skip to content

Commit 67d53a3

Browse files
authored
Merge pull request #228 from SingingBush/build/github_actions
#227 use Github Actions for CI
2 parents e52eacf + e95741d commit 67d53a3

38 files changed

+342
-657
lines changed

.github/workflows/dub.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Builds
2+
3+
# Overall MySQL Native should work on the last 10 minor compiler releases (same as Vibe.d).
4+
# For simplicity and speed of the CI, the latest versions of dmd and ldc must are tested on
5+
# all platforms (Windows, Linux, and Mac) with older compilers only being tested on Windows/Linux.
6+
# The integration testing (via examples) is done on Linux against Mysql 5.7
7+
8+
on:
9+
schedule:
10+
- cron: '30 7 1 * *'
11+
push:
12+
pull_request:
13+
14+
jobs:
15+
build:
16+
name: ${{ matrix.compiler }} on ${{ matrix.os }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ ubuntu-latest, windows-latest, macos-latest ]
22+
compiler:
23+
- dmd-latest
24+
- ldc-latest
25+
- dmd-2.096.1
26+
- dmd-2.095.1
27+
- dmd-2.094.2
28+
- ldc-1.25.1 # eq to dmd v2.095.1
29+
- ldc-1.24.0 # eq to dmd v2.094.1
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- name: Install D ${{ matrix.compiler }}
34+
uses: dlang-community/setup-dlang@v1
35+
with:
36+
compiler: ${{ matrix.compiler }}
37+
38+
- name: Upgrade dub dependencies
39+
uses: WebFreak001/[email protected]
40+
41+
- name: Build Library
42+
run: dub build --build=release --config=library
43+
44+
# cache
45+
- uses: WebFreak001/[email protected]
46+
if: startsWith(matrix.os, 'windows')
47+
with: { store: true }
48+
49+
# Older compiler versions
50+
build-older:
51+
name: ${{ matrix.compiler }} on ${{ matrix.os }}
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
os: [ ubuntu-latest, windows-latest ] # don't bother with macos-latest
56+
compiler:
57+
- dmd-2.093.1
58+
- dmd-2.092.1
59+
- dmd-2.091.1
60+
- dmd-2.090.1
61+
- dmd-2.089.1
62+
- dmd-2.088.1
63+
- dmd-2.087.1
64+
- dmd-2.086.1
65+
- dmd-2.085.1
66+
- dmd-2.084.1
67+
- dmd-2.083.1
68+
- dmd-2.082.1
69+
- dmd-2.081.2
70+
- dmd-2.080.1
71+
- ldc-1.23.0 # eq to dmd v2.093.1
72+
- ldc-1.22.0 # eq to dmd v2.092.1
73+
- ldc-1.21.0 # eq to dmd v2.091.1
74+
- ldc-1.20.1 # eq to dmd v2.090.1
75+
- ldc-1.19.0 # eq to dmd v2.089.1
76+
runs-on: ${{ matrix.os }}
77+
78+
steps:
79+
- uses: actions/checkout@v2
80+
81+
- name: Install D ${{ matrix.compiler }}
82+
uses: dlang-community/setup-dlang@v1
83+
with:
84+
compiler: ${{ matrix.compiler }}
85+
86+
- name: Upgrade dub dependencies
87+
uses: WebFreak001/[email protected]
88+
89+
- name: Build Library
90+
run: dub build --build=release --config=library
91+
92+
# cache
93+
- uses: WebFreak001/[email protected]
94+
with: { store: true }
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
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"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
# Ignore dub output (selections should not be committed)
2+
.dub/
3+
dub.selections.json
4+
15
*.[oa]
26
*.so
37
*.lib
48
*.dll
59
*.exe
6-
.dub
710
/bin
811
/testConnectionStr.txt
912

File renamed without changes.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
[![Build Status](https://travis-ci.org/mysql-d/mysql-native.svg?branch=master)](https://travis-ci.org/mysql-d/mysql-native)
1+
MySQL native
2+
============
3+
4+
[![DUB Package](https://img.shields.io/dub/v/mysql-native.svg)](https://code.dlang.org/packages/mysql-native)
5+
[![GitHub - Builds](https://github.com/mysql-d/mysql-native/actions/workflows/dub.yml/badge.svg)](https://github.com/mysql-d/mysql-native/actions/workflows/dub.yml)
6+
[![GitHub - Integration Tests](https://github.com/mysql-d/mysql-native/actions/workflows/integration-testing.yml/badge.svg)](https://github.com/mysql-d/mysql-native/actions/workflows/integration-testing.yml)
27

38
A [Boost-licensed](http://www.boost.org/LICENSE_1_0.txt) native [D](http://dlang.org)
49
client driver for MySQL and MariaDB.
@@ -16,8 +21,7 @@ type based on whether Vibe.d is used in your project. (If you use
1621
Otherwise, you can use `-version=Have_vibe_d_core` to force Vibe.d sockets
1722
instead of Phobos ones.)
1823

19-
See [.travis.yml](https://github.com/mysql-d/mysql-native/blob/master/.travis.yml)
20-
for a list of officially supported D compiler versions.
24+
Should work on D compilers from 2.068 through to the latest release but the CI only tests against version 2.080.1 and above. For a full list see the builds on Github Actions.
2125

2226
In this document:
2327
* [API](#api)

ddox/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
.dub
1+
# Ignore dub output (selections should not be committed)
2+
.dub/
3+
dub.selections.json
4+
25
/ddox
36
/__*
47
node_modules

ddox/dub.sdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ homepage "https://github.com/rejectedsoftware/ddox"
44
authors "Sönke Ludwig"
55
license "MIT"
66

7-
dependency "vibe-d:web" version=">=0.7.31 <0.9.0"
8-
dependency "hyphenate" version="~>1.1.0"
9-
dependency "libdparse" version="~>0.8.0"
7+
dependency "vibe-d:web" version=">=0.9.0"
8+
dependency "hyphenate" version="~>1.1.2"
9+
dependency "libdparse" version="~>0.17.0"
1010

1111
configuration "application" {
1212
targetType "executable"

ddox/dub.selections.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)