Skip to content

Commit c7fcadb

Browse files
committed
Adapt GA tests
1 parent b1d950e commit c7fcadb

File tree

1 file changed

+42
-78
lines changed

1 file changed

+42
-78
lines changed

.github/workflows/sqlx.yml

Lines changed: 42 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -225,92 +225,24 @@ jobs:
225225
# but `PgLTree` should just fall back to text format
226226
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}
227227

228-
postgres_native_cert:
229-
name: Postgres Openssl Certificate Authentication
230-
runs-on: ubuntu-20.04
231-
strategy:
232-
matrix:
233-
postgres: [12, 10, 9_6, 9_5]
234-
runtime: [async-std-native-tls, tokio-native-tls, actix-native-tls]
235-
needs: check
236-
steps:
237-
- uses: actions/checkout@v2
238-
239-
- uses: actions-rs/toolchain@v1
240-
with:
241-
profile: minimal
242-
toolchain: stable
243-
override: true
244-
245-
- uses: actions/cache@v2
246-
with:
247-
path: |
248-
~/.cargo/registry
249-
~/.cargo/git
250-
target
251-
key: ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
252-
253-
- uses: actions-rs/cargo@v1
254-
with:
255-
command: build
256-
args: >
257-
--features postgres,openssl,all-types,runtime-${{ matrix.runtime }}
258-
259-
- run: docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 postgres_${{ matrix.postgres }}_cert
260-
- run: sleep 10
261-
262-
- uses: actions-rs/cargo@v1
263-
with:
264-
command: test
265-
args: >
266-
--no-default-features
267-
--features any,postgres,openssl,macros,migrate,all-types,runtime-${{ matrix.runtime }}
268-
env:
269-
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
270-
271-
272-
postgres_cert:
273-
name: Postgres Rustls Certificate Authentication
274-
runs-on: ubuntu-20.04
275-
strategy:
276-
matrix:
277-
postgres: [12, 10, 9_6, 9_5]
278-
runtime: [async-std-rustls, tokio-rustls, actix-rustls]
279-
needs: check
280-
steps:
281-
- uses: actions/checkout@v2
282-
283-
- uses: actions-rs/toolchain@v1
284-
with:
285-
profile: minimal
286-
toolchain: stable
287-
override: true
288-
289-
- uses: actions/cache@v2
290-
with:
291-
path: |
292-
~/.cargo/registry
293-
~/.cargo/git
294-
target
295-
key: ${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }}
228+
# client SSL authentication
296229

297-
- uses: actions-rs/cargo@v1
298-
with:
299-
command: build
300-
args: >
301-
--features postgres,all-types,runtime-${{ matrix.runtime }}
302-
303-
- run: docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 postgres_${{ matrix.postgres }}_cert
304-
- run: sleep 10
230+
- run: |
231+
docker-compose -f tests/docker-compose.yml stop postgres_${{ matrix.postgres }}
232+
docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }}_client_ssl postgres_${{ matrix.postgres }}_client_ssl
233+
docker exec postgres_${{ matrix.postgres }}_client_ssl bash -c "until pg_isready; do sleep 1; done"
305234
306235
- uses: actions-rs/cargo@v1
307236
with:
308237
command: test
309238
args: >
310239
--no-default-features
311-
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}
240+
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
312241
env:
313-
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
242+
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
243+
# FIXME: needed to disable `ltree` tests in Postgres 9.6
244+
# but `PgLTree` should just fall back to text format
245+
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}_client_ssl
314246

315247
mysql:
316248
name: MySQL
@@ -363,6 +295,22 @@ jobs:
363295
env:
364296
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
365297

298+
# client SSL authentication
299+
300+
- run: |
301+
docker-compose -f tests/docker-compose.yml stop mysql_${{ matrix.mysql }}
302+
docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}_client_ssl
303+
sleep 60
304+
305+
- uses: actions-rs/cargo@v1
306+
with:
307+
command: test
308+
args: >
309+
--no-default-features
310+
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
311+
env:
312+
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
313+
366314
mariadb:
367315
name: MariaDB
368316
runs-on: ubuntu-20.04
@@ -403,6 +351,22 @@ jobs:
403351
env:
404352
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
405353

354+
# client SSL authentication
355+
356+
- run: |
357+
docker-compose -f tests/docker-compose.yml stop mysql_${{ matrix.mysql }}
358+
docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}_client_ssl
359+
sleep 60
360+
361+
- uses: actions-rs/cargo@v1
362+
with:
363+
command: test
364+
args: >
365+
--no-default-features
366+
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
367+
env:
368+
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
369+
406370
mssql:
407371
name: MSSQL
408372
runs-on: ubuntu-20.04

0 commit comments

Comments
 (0)