Skip to content

Commit 14e844f

Browse files
committed
refactor(ci): Start postgres docker container before building tests (allows more startup time for postgres)
Signed-off-by: Joshua Potts <[email protected]>
1 parent 0fbb216 commit 14e844f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/sqlx.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,17 @@ jobs:
220220

221221
- uses: Swatinem/rust-cache@v2
222222

223+
- run: |
224+
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
225+
docker exec postgres_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
226+
223227
- env:
224228
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}"
225229
run: >
226230
cargo build
227231
--no-default-features
228232
--features postgres,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }},macros,migrate
229233
230-
- run: |
231-
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
232-
docker exec postgres_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
233-
234234
# Create data dir for offline mode
235235
- run: mkdir .sqlx
236236

0 commit comments

Comments
 (0)