Skip to content

Commit 00bab95

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pg-call-procedure
2 parents e7cf862 + c17c59f commit 00bab95

File tree

426 files changed

+10696
-12925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+10696
-12925
lines changed

.github/workflows/sqlx.yml

+82-59
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- '*-dev'
89

910
jobs:
1011
format:
@@ -32,8 +33,8 @@ jobs:
3233
runs-on: ubuntu-20.04
3334
strategy:
3435
matrix:
35-
runtime: [async-std, tokio, actix]
36-
tls: [native-tls, rustls]
36+
runtime: [async-std, tokio]
37+
tls: [native-tls, rustls, none]
3738
steps:
3839
- uses: actions/checkout@v2
3940

@@ -53,22 +54,22 @@ jobs:
5354
args: >
5455
--manifest-path sqlx-core/Cargo.toml
5556
--no-default-features
56-
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
57+
--features json,offline,migrate,_rt-${{ matrix.runtime }},_tls-${{ matrix.tls }}
5758
5859
- uses: actions-rs/cargo@v1
5960
with:
6061
command: check
6162
args: >
6263
--no-default-features
63-
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }},macros
64+
--features all-databases,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }},macros
6465
6566
test:
6667
name: Unit Test
6768
runs-on: ubuntu-20.04
6869
strategy:
6970
matrix:
70-
runtime: [async-std, tokio, actix]
71-
tls: [native-tls, rustls]
71+
runtime: [async-std, tokio]
72+
tls: [native-tls, rustls, none]
7273
steps:
7374
- uses: actions/checkout@v2
7475

@@ -87,7 +88,7 @@ jobs:
8788
command: test
8889
args: >
8990
--manifest-path sqlx-core/Cargo.toml
90-
--features offline,all-databases,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
91+
--features json,_rt-${{ matrix.runtime }},_tls-${{ matrix.tls }}
9192
9293
cli:
9394
name: CLI Binaries
@@ -138,8 +139,7 @@ jobs:
138139
runs-on: ubuntu-20.04
139140
strategy:
140141
matrix:
141-
runtime: [async-std, tokio, actix]
142-
tls: [native-tls, rustls]
142+
runtime: [async-std, tokio]
143143
needs: check
144144
steps:
145145
- uses: actions/checkout@v2
@@ -156,16 +156,18 @@ jobs:
156156
with:
157157
key: ${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }}
158158

159+
- run: echo "using ${DATABASE_URL}"
160+
159161
- uses: actions-rs/cargo@v1
160162
with:
161163
command: test
162164
args: >
163165
--no-default-features
164-
--features any,macros,migrate,sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
166+
--features any,macros,sqlite,_unstable-all-types,runtime-${{ matrix.runtime }}
165167
--
166168
--test-threads=1
167169
env:
168-
DATABASE_URL: sqlite://tests/sqlite/sqlite.db
170+
DATABASE_URL: sqlite:tests/sqlite/sqlite.db
169171
RUSTFLAGS: --cfg sqlite_ipaddr
170172
LD_LIBRARY_PATH: /tmp/sqlite3-lib
171173

@@ -174,9 +176,9 @@ jobs:
174176
runs-on: ubuntu-20.04
175177
strategy:
176178
matrix:
177-
postgres: [14, 10]
178-
runtime: [async-std, tokio, actix]
179-
tls: [native-tls, rustls]
179+
postgres: [15, 11]
180+
runtime: [async-std, tokio]
181+
tls: [native-tls, rustls, none]
180182
needs: check
181183
steps:
182184
- uses: actions/checkout@v2
@@ -199,7 +201,7 @@ jobs:
199201
with:
200202
command: build
201203
args: >
202-
--features postgres,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
204+
--features postgres,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
203205
204206
- run: |
205207
docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
@@ -210,33 +212,54 @@ jobs:
210212
command: test
211213
args: >
212214
--no-default-features
213-
--features any,postgres,macros,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
215+
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
214216
env:
215217
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
216218
# FIXME: needed to disable `ltree` tests in Postgres 9.6
217219
# but `PgLTree` should just fall back to text format
218220
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
219221

220222
- uses: actions-rs/cargo@v1
223+
if: matrix.tls != 'none'
221224
with:
222225
command: test
223226
args: >
224227
--no-default-features
225-
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
228+
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
226229
env:
227230
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt
228231
# FIXME: needed to disable `ltree` tests in Postgres 9.6
229232
# but `PgLTree` should just fall back to text format
230233
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
231234

235+
# client SSL authentication
236+
237+
- run: |
238+
docker stop postgres_${{ matrix.postgres }}
239+
docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }}_client_ssl postgres_${{ matrix.postgres }}_client_ssl
240+
docker exec postgres_${{ matrix.postgres }}_client_ssl bash -c "until pg_isready; do sleep 1; done"
241+
242+
- uses: actions-rs/cargo@v1
243+
if: matrix.tls != 'none'
244+
with:
245+
command: test
246+
args: >
247+
--no-default-features
248+
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
249+
env:
250+
DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt
251+
# FIXME: needed to disable `ltree` tests in Postgres 9.6
252+
# but `PgLTree` should just fall back to text format
253+
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}_client_ssl
254+
232255
mysql:
233256
name: MySQL
234257
runs-on: ubuntu-20.04
235258
strategy:
236259
matrix:
237260
mysql: [8, 5_7]
238-
runtime: [async-std, tokio, actix]
239-
tls: [native-tls, rustls]
261+
runtime: [async-std, tokio]
262+
tls: [native-tls, rustls, none]
240263
needs: check
241264
steps:
242265
- uses: actions/checkout@v2
@@ -255,19 +278,20 @@ jobs:
255278
with:
256279
command: build
257280
args: >
258-
--features mysql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
281+
--features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
259282
260-
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}
283+
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
261284
- run: sleep 60
262285

263286
- uses: actions-rs/cargo@v1
264287
with:
265288
command: test
266289
args: >
267290
--no-default-features
268-
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
291+
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
269292
env:
270293
DATABASE_URL: mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled
294+
RUSTFLAGS: --cfg mysql_${{ matrix.mysql }}
271295

272296
# MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS.
273297
- uses: actions-rs/cargo@v1
@@ -276,18 +300,38 @@ jobs:
276300
command: test
277301
args: >
278302
--no-default-features
279-
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
303+
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
280304
env:
281305
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
306+
RUSTFLAGS: --cfg mysql_${{ matrix.mysql }}
307+
308+
# client SSL authentication
309+
310+
- run: |
311+
docker stop mysql_${{ matrix.mysql }}
312+
docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_${{ matrix.mysql }}_client_ssl mysql_${{ matrix.mysql }}_client_ssl
313+
sleep 60
314+
315+
# MySQL 5.7 supports TLS but not TLSv1.3 as required by RusTLS.
316+
- uses: actions-rs/cargo@v1
317+
if: ${{ !(matrix.mysql == '5_7' && matrix.tls == 'rustls') && matrix.tls != 'none' }}
318+
with:
319+
command: test
320+
args: >
321+
--no-default-features
322+
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
323+
env:
324+
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
325+
RUSTFLAGS: --cfg mysql_${{ matrix.mysql }}
282326

283327
mariadb:
284328
name: MariaDB
285329
runs-on: ubuntu-20.04
286330
strategy:
287331
matrix:
288332
mariadb: [10_6, 10_3]
289-
runtime: [async-std, tokio, actix]
290-
tls: [native-tls, rustls]
333+
runtime: [async-std, tokio]
334+
tls: [native-tls, rustls, none]
291335
needs: check
292336
steps:
293337
- uses: actions/checkout@v2
@@ -306,56 +350,35 @@ jobs:
306350
with:
307351
command: build
308352
args: >
309-
--features mysql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
353+
--features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
310354
311-
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mariadb_${{ matrix.mariadb }}
355+
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mariadb_${{ matrix.mariadb }} mariadb_${{ matrix.mariadb }}
312356
- run: sleep 30
313357

314358
- uses: actions-rs/cargo@v1
315359
with:
316360
command: test
317361
args: >
318362
--no-default-features
319-
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
363+
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
320364
env:
321365
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
366+
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}
322367

323-
mssql:
324-
name: MSSQL
325-
runs-on: ubuntu-20.04
326-
strategy:
327-
matrix:
328-
mssql: [2019, 2017]
329-
runtime: [async-std, tokio, actix]
330-
tls: [native-tls, rustls]
331-
needs: check
332-
steps:
333-
- uses: actions/checkout@v2
334-
335-
- uses: actions-rs/toolchain@v1
336-
with:
337-
profile: minimal
338-
toolchain: stable
339-
override: true
340-
341-
- uses: Swatinem/rust-cache@v1
342-
with:
343-
key: ${{ runner.os }}-mssql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}
368+
# client SSL authentication
344369

345-
- uses: actions-rs/cargo@v1
346-
with:
347-
command: build
348-
args: >
349-
--features mssql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
350-
351-
- run: docker-compose -f tests/docker-compose.yml run -d -p 1433:1433 mssql_${{ matrix.mssql }}
352-
- run: sleep 80 # MSSQL takes a "bit" to startup
370+
- run: |
371+
docker stop mariadb_${{ matrix.mariadb }}
372+
docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mariadb_${{ matrix.mariadb }}_client_ssl mariadb_${{ matrix.mariadb }}_client_ssl
373+
sleep 60
353374
354375
- uses: actions-rs/cargo@v1
376+
if: matrix.tls != 'none'
355377
with:
356378
command: test
357379
args: >
358380
--no-default-features
359-
--features any,mssql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
381+
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
360382
env:
361-
DATABASE_URL: mssql://sa:Password123!@localhost/sqlx
383+
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
384+
RUSTFLAGS: --cfg mariadb_${{ matrix.mariadb }}

0 commit comments

Comments
 (0)