-
Notifications
You must be signed in to change notification settings - Fork 45
226 lines (193 loc) · 8.07 KB
/
dub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: CI
# Overall ddbc should work on the last 10 minor compiler releases (same as Vibe.d).
# For simplicity and speed of the CI, some compiler versions are skipped. The latest
# versions of dmd and ldc must be tested on all platforms (Windows, Linux, and Mac)
# with older compilers only being tested on Windows/Linux.
# The integration testing is done on Linux against Mysql and Postgres
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 ]
compiler:
- dmd-latest
- ldc-latest
- dmd-2.109.1 # (released in 2024)
- dmd-2.108.1 # (released in 2024)
- dmd-2.107.1 # (released in 2024)
- dmd-2.106.1 # (released in 2024)
- dmd-2.105.3 # (released in 2023)
- dmd-2.104.2 # (released in 2023)
- dmd-2.103.1 # (released in 2023)
- dmd-2.102.2 # (released in 2023)
- dmd-2.101.2 # (released in 2023)
- dmd-2.100.2 # (released in 2022) ## GDC 12 can support 2.100
- dmd-2.099.1 # (released in 2022)
- dmd-2.098.1 # (released in 2021) ## Has issue re: phobos/std/variant.d
- dmd-2.097.2 # (released in 2021)
- ldc-1.33.0 # eq to dmd v2.103.1
- ldc-1.32.2 # eq to dmd v2.102.2
- ldc-1.28.1 # eq to dmd v2.098.1
- ldc-1.27.1 # eq to dmd v2.097.2
include:
## LDC supports Apple silicon
- { os: macos-latest, compiler: ldc-latest }
## macos-13 is the latest Mac runner with Intel cpu
- { os: macos-13, compiler: dmd-latest }
- { os: macos-13, compiler: ldc-latest }
- { os: macos-13, compiler: dmd-2.108.1 }
- { os: macos-13, compiler: ldc-1.32.2 }
exclude:
- { os: windows-latest, compiler: dmd-2.098.1 }
- { os: windows-latest, compiler: dmd-2.097.2 }
steps:
- uses: actions/checkout@v4
- 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 libev-dev libpq-dev libevent-dev libsqlite3-dev -y
- name: Install dependencies on Mac OSX
if: startsWith(matrix.os, 'macos')
run: brew bundle
# Seems ODBC is missing on the latest macos runners so install using homebrew
- name: Install ODBC on Mac OSX ${{ runner.arch }}
if: ${{ startsWith(matrix.os, 'macos') && runner.arch == 'ARM64' }}
run: |
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18
# - name: Upgrade dub dependencies
# if: startsWith(matrix.os, 'windows')
# uses: WebFreak001/dub-upgrade@v0.1
# full build
- name: dub build (FULL) ${{ runner.arch }}
run: dub build --config=full
# x86 (Windows Only)
- name: dub test with full config (x86)
if: ${{ startsWith(matrix.os, 'windows') }}
run: dub test --config=full --arch=x86
#- name: dub run with test config (x86)
# if: ${{ startsWith(matrix.os, 'windows') }}
# run: dub run --config=test --arch=x86
- name: run the ddbctest project (x86)
if: ${{ startsWith(matrix.os, 'windows') }}
working-directory: example
run: dub build --config=SQLite --arch=x86 && ./ddbctest --connection=sqlite:ddbc-test.sqlite
# Use the default arch (either x86_64 or aarch64 all platforms)
- name: dub test with full config (${{ runner.arch }})
run: dub test --config=full
#- name: dub run with test config (x86_64)
# run: dub run --config=test --arch=x86_64
- name: run the ddbctest project (${{ runner.arch }})
working-directory: example
run: dub build --config=SQLite && ./ddbctest --connection=sqlite:ddbc-test.sqlite
# x86_mscoff (Windows with dmd Only)
- name: dub test with full config (x86_mscoff)
if: ${{ startsWith(matrix.os, 'windows') && startsWith(matrix.compiler, 'dmd') }}
run: dub test --config=full --arch=x86_mscoff
#- name: dub run with test config (x86_mscoff)
# if: ${{ startsWith(matrix.os, 'windows') && startsWith(matrix.compiler, 'dmd') }}
# run: dub run --config=test --arch=x86_mscoff
- name: run the ddbctest project (x86_mscoff)
if: ${{ startsWith(matrix.os, 'windows') && startsWith(matrix.compiler, 'dmd') }}
working-directory: example
run: dub build --config=SQLite --arch=x86_mscoff && ./ddbctest --connection=sqlite:ddbc-test.sqlite
# # cache
# - uses: WebFreak001/dub-upgrade@v0.1
# if: startsWith(matrix.os, 'windows')
# 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
postgres:
image: postgres
ports: [5432]
env:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
POSTGRES_PASSWORD: passw0rd
# Set health checks to wait until postgres service has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 3s
--health-retries 3
mssql:
#image: microsoft/mssql-server-linux:2017-latest
#image: mcr.microsoft.com/mssql/server:2019-latest
image: mcr.microsoft.com/mssql/server:2022-latest
ports: [1433]
env:
MSSQL_PID: Developer
SA_PASSWORD: MSbbk4k77JKH88g54
ACCEPT_EULA: Y
# options: >-
# --health-cmd "sqlcmd -S localhost -U sa -P MSbbk4k77JKH88g54 -Q 'SELECT 1' || exit 1"
# --health-interval 10s
# --health-timeout 3s
# --health-retries 3
steps:
- uses: actions/checkout@v4
- name: Install latest DMD
uses: dlang-community/setup-dlang@v1
with:
compiler: dmd-latest
- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y
- name: Run ddbctest
env:
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
MSSQL_PORT: ${{ job.services.mssql.ports[1433] }}
run: dub run --config=test
- name: Build The Example Project
working-directory: ./example
run: dub build
- name: Run The Examples (SQLite)
working-directory: ./example
run: |
./ddbctest --connection=sqlite::memory:
- name: Run The Examples (MySQL)
working-directory: ./example
env:
PORT: ${{ job.services.mysql.ports[3306] }}
run: |
./ddbctest --connection=mysql://127.0.0.1:$PORT --database=testdb --user=testuser --password=passw0rd
- name: Run The Examples (Postgres)
working-directory: ./example
env:
PORT: ${{ job.services.postgres.ports[5432] }}
run: |
./ddbctest --connection=postgresql://127.0.0.1:$PORT --database=testdb --user=testuser --password=passw0rd
- name: Run The Examples (SQL Server)
working-directory: ./example
env:
PORT: ${{ job.services.mssql.ports[1433] }}
run: |
./ddbctest --connection=odbc://127.0.0.1:$PORT --user=SA --password=MSbbk4k77JKH88g54 --driver="ODBC Driver 18 for SQL Server" --trusted_connection=yes