Skip to content

Commit 866f7f1

Browse files
committed
mysql-d#227 use Github Actions for CI
1 parent e52eacf commit 866f7f1

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

.github/workflows/dub.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: CI
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+
test:
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: Install dependencies on Ubuntu
39+
# if: startsWith(matrix.os, 'ubuntu')
40+
# run: sudo apt-get update && sudo apt-get install libev-dev libpq-dev libevent-dev libsqlite3-dev -y
41+
42+
# - name: Install dependencies on Mac OSX
43+
# if: startsWith(matrix.os, 'macos')
44+
# run: brew bundle
45+
46+
- name: Upgrade dub dependencies
47+
uses: WebFreak001/[email protected]
48+
49+
- name: Ensure project builds
50+
run: dub build
51+
52+
# - name: Run Tests (phobos)
53+
# run: ./run_tests --mode=phobos
54+
55+
# - name: Run Tests (vibe)
56+
# run: ./run_tests --mode=vibe
57+
58+
# cache
59+
- uses: WebFreak001/[email protected]
60+
if: startsWith(matrix.os, 'windows')
61+
with: { store: true }
62+
63+
# Older compiler versions
64+
test-older:
65+
name: ${{ matrix.compiler }} on ${{ matrix.os }}
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os: [ ubuntu-latest, windows-latest ] # don't bother with macos-latest
70+
compiler:
71+
- dmd-2.093.1
72+
- dmd-2.092.1
73+
- dmd-2.091.1
74+
- dmd-2.090.1
75+
- dmd-2.089.1
76+
- ldc-1.23.0 # eq to dmd v2.093.1
77+
- ldc-1.22.0 # eq to dmd v2.092.1
78+
- ldc-1.21.0 # eq to dmd v2.091.1
79+
- ldc-1.20.1 # eq to dmd v2.090.1
80+
- ldc-1.19.0 # eq to dmd v2.089.1
81+
runs-on: ${{ matrix.os }}
82+
steps:
83+
- uses: actions/checkout@v2
84+
85+
- name: Install D ${{ matrix.compiler }}
86+
uses: dlang-community/setup-dlang@v1
87+
with:
88+
compiler: ${{ matrix.compiler }}
89+
90+
# - name: Install dependencies on Ubuntu
91+
# if: startsWith(matrix.os, 'ubuntu')
92+
# run: sudo apt-get update && sudo apt-get install libev-dev libpq-dev libevent-dev libsqlite3-dev -y
93+
94+
- name: Upgrade dub dependencies
95+
uses: WebFreak001/[email protected]
96+
97+
- name: Ensure project builds
98+
run: dub build
99+
100+
# cache
101+
- uses: WebFreak001/[email protected]
102+
with: { store: true }
103+
104+
integration-tests:
105+
name: Integration Tests
106+
runs-on: ubuntu-20.04
107+
108+
services:
109+
mysql:
110+
image: mysql:5.7
111+
ports: [3306]
112+
env:
113+
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ
114+
MYSQL_DATABASE: testdb
115+
MYSQL_USER: testuser
116+
MYSQL_PASSWORD: passw0rd
117+
# Set health checks to wait until mysql service has started
118+
options: >-
119+
--health-cmd "mysqladmin ping"
120+
--health-interval 10s
121+
--health-timeout 3s
122+
--health-retries 4
123+
124+
steps:
125+
- uses: actions/checkout@v2
126+
127+
- name: Install latest DMD
128+
uses: dlang-community/setup-dlang@v1
129+
with:
130+
compiler: dmd-latest
131+
132+
- name: Build The Example Project
133+
working-directory: ./examples/homePage
134+
run: dub build
135+
136+
- name: Run The Examples (SQLite)
137+
working-directory: ./examples/homePage
138+
run: |
139+
./example "host=localhost;port=3306;user=testuser;pwd=passw0rd;db=testdb"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
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 CI](https://github.com/mysql-d/mysql-native/actions/workflows/dub.yml/badge.svg)](https://github.com/mysql-d/mysql-native/actions/workflows/dub.yml)
16
[![Build Status](https://travis-ci.org/mysql-d/mysql-native.svg?branch=master)](https://travis-ci.org/mysql-d/mysql-native)
27

38
A [Boost-licensed](http://www.boost.org/LICENSE_1_0.txt) native [D](http://dlang.org)

0 commit comments

Comments
 (0)