-
Notifications
You must be signed in to change notification settings - Fork 28
#227 use Github Actions for CI #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
866f7f1
426fc83
26b0c7c
3c89950
3c3d41f
fb8d6e8
fd102cf
9c1cee0
194974a
b285b33
3e1a929
df5f5e5
a588a46
958773d
bd7ada0
39b86f5
59b7cbe
b51f0dd
db2df74
e95741d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
name: CI | ||
|
||
# Overall MySQL Native should work on the last 10 minor compiler releases (same as Vibe.d). | ||
# For simplicity and speed of the CI, the latest versions of dmd and ldc must are tested on | ||
# all platforms (Windows, Linux, and Mac) with older compilers only being tested on Windows/Linux. | ||
# The integration testing (via examples) is done on Linux against Mysql 5.7 | ||
|
||
on: | ||
schedule: | ||
- cron: '30 7 1 * *' | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.compiler }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
compiler: | ||
- dmd-latest | ||
- ldc-latest | ||
- dmd-2.096.1 | ||
- dmd-2.095.1 | ||
- dmd-2.094.2 | ||
- ldc-1.25.1 # eq to dmd v2.095.1 | ||
- ldc-1.24.0 # eq to dmd v2.094.1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install D ${{ matrix.compiler }} | ||
uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ${{ matrix.compiler }} | ||
|
||
# - name: Install dependencies on Ubuntu | ||
# if: startsWith(matrix.os, 'ubuntu') | ||
# run: sudo apt-get update && sudo apt-get install libevent-dev -y | ||
|
||
# - name: Install dependencies on Mac OSX | ||
# if: startsWith(matrix.os, 'macos') | ||
# run: brew bundle | ||
|
||
- name: Upgrade dub dependencies | ||
uses: WebFreak001/[email protected] | ||
|
||
- name: Build Library | ||
run: dub build --build=release --config=library | ||
|
||
## Turns out the unittest-vibe-ut tried to connect to an actualy MySQL on 172.18.0.1 so it's not | ||
## actually a unit test at all. It's an integration test and should be pulled out of the codebase. | ||
# - name: Run unittest-vibe-ut | ||
# run: dub run -c unittest-vibe-ut -- -t | ||
|
||
# - name: Run Tests (phobos) | ||
# run: ./run_tests --mode=phobos | ||
|
||
# - name: Run Tests (vibe) | ||
# run: ./run_tests --mode=vibe | ||
|
||
# cache | ||
- uses: WebFreak001/[email protected] | ||
if: startsWith(matrix.os, 'windows') | ||
with: { store: true } | ||
|
||
# Older compiler versions | ||
test-older: | ||
name: ${{ matrix.compiler }} on ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] # don't bother with macos-latest | ||
compiler: | ||
- dmd-2.093.1 | ||
- dmd-2.092.1 | ||
- dmd-2.091.1 | ||
- dmd-2.090.1 | ||
- dmd-2.089.1 | ||
- dmd-2.088.1 | ||
- dmd-2.087.1 | ||
- dmd-2.086.1 | ||
- dmd-2.085.1 | ||
- dmd-2.084.1 | ||
- dmd-2.083.1 | ||
- dmd-2.082.1 | ||
- dmd-2.081.2 | ||
- dmd-2.080.1 | ||
- ldc-1.23.0 # eq to dmd v2.093.1 | ||
- ldc-1.22.0 # eq to dmd v2.092.1 | ||
- ldc-1.21.0 # eq to dmd v2.091.1 | ||
- ldc-1.20.1 # eq to dmd v2.090.1 | ||
- ldc-1.19.0 # eq to dmd v2.089.1 | ||
Comment on lines
+54
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of duplicating the code you can add matrix row via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the include/exclude options look handy I'll take a look once I've finished getting the tests running. I hate that the supposed unit tests are actually integration tests but would like to run them at least before moving things around. So far I feel the changes are a lot better than the travis builds. I currently have (https://github.com/SingingBush/mysql-native/actions/runs/867000447) 60 jobs running in about 3 minutes, which includes running the example code against MySQL: |
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install D ${{ matrix.compiler }} | ||
uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ${{ matrix.compiler }} | ||
|
||
# - name: Install dependencies on Ubuntu | ||
# if: startsWith(matrix.os, 'ubuntu') | ||
# run: sudo apt-get update && sudo apt-get install libevent-dev -y | ||
|
||
- name: Upgrade dub dependencies | ||
uses: WebFreak001/[email protected] | ||
|
||
- name: Build Library | ||
run: dub build --build=release --config=library | ||
|
||
## Turns out the unittest-vibe-ut tried to connect to an actualy MySQL on 172.18.0.1 so it's not | ||
## actually a unit test at all. It's an integration test and should be pulled out of the codebase. | ||
# - name: Run unittest-vibe-ut | ||
# run: dub run -c unittest-vibe-ut -- -t | ||
|
||
# cache | ||
- uses: WebFreak001/[email protected] | ||
with: { store: true } | ||
|
||
integration-tests: | ||
name: Integration Tests | ||
runs-on: ubuntu-20.04 | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
ports: [3306] | ||
env: | ||
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ | ||
MYSQL_DATABASE: testdb | ||
MYSQL_USER: testuser | ||
MYSQL_PASSWORD: passw0rd | ||
# Set health checks to wait until mysql service has started | ||
options: >- | ||
--health-cmd "mysqladmin ping" | ||
--health-interval 10s | ||
--health-timeout 3s | ||
--health-retries 4 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install latest DMD | ||
uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: dmd-latest | ||
|
||
- name: Install dependencies on Ubuntu | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: sudo apt-get update && sudo apt-get install libevent-dev -y | ||
|
||
- name: Build The Example Project | ||
working-directory: ./examples/homePage | ||
run: dub build | ||
|
||
- name: Run Example (MySQL 5.7) | ||
working-directory: ./examples/homePage | ||
run: | | ||
./example "host=localhost;port=3306;user=testuser;pwd=passw0rd;db=testdb" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
.dub | ||
# Ignore dub output (selections should not be committed) | ||
.dub/ | ||
dub.selections.json | ||
|
||
/ddox | ||
/__* | ||
node_modules | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
name "example" | ||
dependency "mysql-native" path="../.." | ||
description "Simple example of using MySQL Native" | ||
dependency "mysql-native" path="../../" | ||
targetType "executable" | ||
sourcePaths "." | ||
mainSourceFile "example.d" | ||
|
||
configuration "default" { | ||
subConfiguration "mysql-native" "library" | ||
//subConfiguration "vibe-d" "win32" platform="windows-x86_64-dmd" | ||
//excludedSourceFiles "../../source/app.d" | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is already part of the display name in the Github UI so it might be redundant.