Skip to content

Commit e4e19e6

Browse files
committed
refactor(ci): Use separate job for postgres ssl auth tests
Signed-off-by: Joshua Potts <[email protected]>
1 parent 6a90586 commit e4e19e6

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.github/workflows/sqlx.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ jobs:
229229
230230
- run: |
231231
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
232+
233+
- run: |
232234
docker exec postgres_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
233235
234236
# Create data dir for offline mode
@@ -290,23 +292,37 @@ jobs:
290292
SQLX_OFFLINE_DIR: .sqlx
291293
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
292294
293-
# client SSL authentication
295+
postgres-ssl-auth:
296+
name: Postgres SSL Auth
297+
runs-on: ubuntu-24.04
298+
strategy:
299+
matrix:
300+
postgres: [ 13, 17 ]
301+
runtime: [ async-std, tokio ]
302+
tls: [ native-tls, rustls-aws-lc-rs, rustls-ring ]
303+
needs: check
304+
timeout-minutes: 30
305+
steps:
306+
- uses: actions/checkout@v4
294307

295-
- run: |
296-
docker stop postgres_${{ matrix.postgres }}
308+
- name: Setup Rust
309+
run: rustup show active-toolchain || rustup toolchain install
310+
311+
- uses: Swatinem/rust-cache@v2
297312

298313
- run: |
299314
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }}_client_ssl postgres_${{ matrix.postgres }}_client_ssl
315+
316+
- run: |
300317
docker exec postgres_${{ matrix.postgres }}_client_ssl bash -c "until pg_isready; do sleep 1; done"
301318
302-
- if: matrix.tls != 'none'
303-
run: >
319+
- run: >
304320
cargo test
305321
--no-default-features
306322
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
307323
env:
308324
DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt
309-
RUSTFLAGS: --cfg postgres_client_ssl
325+
RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}"
310326
311327
mysql:
312328
name: MySQL

tests/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
services:
42
#
53
# MySQL 8.x, 5.7.x

0 commit comments

Comments
 (0)