Skip to content

Commit a92236f

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

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/sqlx.yml

Lines changed: 22 additions & 4 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,15 +292,31 @@ 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
307+
308+
- name: Setup Rust
309+
run: rustup show active-toolchain || rustup toolchain install
310+
311+
- uses: Swatinem/rust-cache@v2
294312

295313
- run: |
296-
docker stop postgres_${{ matrix.postgres }}
297314
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: |
298317
docker exec postgres_${{ matrix.postgres }}_client_ssl bash -c "until pg_isready; do sleep 1; done"
299318
300-
- if: matrix.tls != 'none'
301-
run: >
319+
- run: >
302320
cargo test
303321
--no-default-features
304322
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ level = 'warn'
245245
check-cfg = [
246246
'cfg(mariadb, values(any()))',
247247
'cfg(postgres, values(any()))',
248+
'cfg(postgres_client_ssl)',
248249
'cfg(sqlite_ipaddr)',
249250
'cfg(sqlite_test_sqlcipher)',
250251
]

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)