@@ -245,92 +245,24 @@ jobs:
245245 # but `PgLTree` should just fall back to text format
246246 RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}
247247
248- postgres_native_cert :
249- name : Postgres Openssl Certificate Authentication
250- runs-on : ubuntu-20.04
251- strategy :
252- matrix :
253- postgres : [12, 10, 9_6, 9_5]
254- runtime : [async-std-native-tls, tokio-native-tls, actix-native-tls]
255- needs : check
256- steps :
257- - uses : actions/checkout@v2
258-
259- - uses : actions-rs/toolchain@v1
260- with :
261- profile : minimal
262- toolchain : stable
263- override : true
264-
265- - uses : actions/cache@v2
266- with :
267- path : |
268- ~/.cargo/registry
269- ~/.cargo/git
270- target
271- key : ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
272-
273- - uses : actions-rs/cargo@v1
274- with :
275- command : build
276- args : >
277- --features postgres,openssl,all-types,runtime-${{ matrix.runtime }}
278-
279- - run : docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 postgres_${{ matrix.postgres }}_cert
280- - run : sleep 10
281-
282- - uses : actions-rs/cargo@v1
283- with :
284- command : test
285- args : >
286- --no-default-features
287- --features any,postgres,openssl,macros,migrate,all-types,runtime-${{ matrix.runtime }}
288- env :
289- DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslcert=.%2Ftests%2Fcerts%2Fclient.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key
290-
291-
292- postgres_cert :
293- name : Postgres Rustls Certificate Authentication
294- runs-on : ubuntu-20.04
295- strategy :
296- matrix :
297- postgres : [12, 10, 9_6, 9_5]
298- runtime : [async-std-rustls, tokio-rustls, actix-rustls]
299- needs : check
300- steps :
301- - uses : actions/checkout@v2
302-
303- - uses : actions-rs/toolchain@v1
304- with :
305- profile : minimal
306- toolchain : stable
307- override : true
308-
309- - uses : actions/cache@v2
310- with :
311- path : |
312- ~/.cargo/registry
313- ~/.cargo/git
314- target
315- key : ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
248+ # client SSL authentication
316249
317- - uses : actions-rs/cargo@v1
318- with :
319- command : build
320- args : >
321- --features postgres,all-types,runtime-${{ matrix.runtime }}
322-
323- - run : docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 postgres_${{ matrix.postgres }}_cert
324- - run : sleep 10
250+ - run : |
251+ docker-compose -f tests/docker-compose.yml stop postgres_${{ matrix.postgres }}
252+ docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }}_client_ssl postgres_${{ matrix.postgres }}_client_ssl
253+ docker exec postgres_${{ matrix.postgres }}_client_ssl bash -c "until pg_isready; do sleep 1; done"
325254
326255 - uses : actions-rs/cargo@v1
327256 with :
328257 command : test
329258 args : >
330259 --no-default-features
331- --features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}
260+ --features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
332261 env :
333- DATABASE_URL : postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslcert=.%2Ftests%2Fcerts%2Fclient.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key
262+ 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
263+ # FIXME: needed to disable `ltree` tests in Postgres 9.6
264+ # but `PgLTree` should just fall back to text format
265+ RUSTFLAGS : --cfg postgres_${{ matrix.postgres }}_client_ssl
334266
335267 mysql :
336268 name : MySQL
@@ -376,6 +308,22 @@ jobs:
376308 env :
377309 DATABASE_URL : mysql://root:password@localhost:3306/sqlx
378310
311+ # client SSL authentication
312+
313+ - run : |
314+ docker-compose -f tests/docker-compose.yml stop mysql_${{ matrix.mysql }}
315+ docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}_client_ssl
316+ sleep 60
317+
318+ - uses : actions-rs/cargo@v1
319+ with :
320+ command : test
321+ args : >
322+ --no-default-features
323+ --features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
324+ env :
325+ 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
326+
379327 mariadb :
380328 name : MariaDB
381329 runs-on : ubuntu-20.04
@@ -421,6 +369,22 @@ jobs:
421369 env :
422370 DATABASE_URL : mysql://root:password@localhost:3306/sqlx
423371
372+ # client SSL authentication
373+
374+ - run : |
375+ docker-compose -f tests/docker-compose.yml stop mysql_${{ matrix.mysql }}
376+ docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}_client_ssl
377+ sleep 60
378+
379+ - uses : actions-rs/cargo@v1
380+ with :
381+ command : test
382+ args : >
383+ --no-default-features
384+ --features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
385+ env :
386+ 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
387+
424388 mssql :
425389 name : MSSQL
426390 runs-on : ubuntu-20.04
0 commit comments