Skip to content

Commit 6b0d226

Browse files
chore: wip
1 parent c3c3b08 commit 6b0d226

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,29 @@ jobs:
6363
test:
6464
runs-on: ubuntu-latest
6565

66+
services:
67+
postgres:
68+
image: postgres:15
69+
env:
70+
POSTGRES_PASSWORD: postgres
71+
POSTGRES_USER: postgres
72+
POSTGRES_DB: test_db
73+
options: >-
74+
--health-cmd pg_isready
75+
--health-interval 10s
76+
--health-timeout 5s
77+
--health-retries 5
78+
ports:
79+
- 5432:5432
80+
81+
env:
82+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
83+
POSTGRES_HOST: localhost
84+
POSTGRES_PORT: 5432
85+
POSTGRES_USER: postgres
86+
POSTGRES_PASSWORD: postgres
87+
POSTGRES_DB: test_db
88+
6689
steps:
6790
- uses: actions/checkout@v4
6891

@@ -80,6 +103,12 @@ jobs:
80103
- name: Install Dependencies
81104
run: bun install
82105

106+
- name: Wait for PostgreSQL
107+
run: |
108+
echo "Waiting for PostgreSQL to be ready..."
109+
timeout 60 bash -c 'until pg_isready -h localhost -p 5432 -U postgres; do sleep 1; done'
110+
echo "PostgreSQL is ready!"
111+
83112
- name: Unit Test
84113
run: bun test
85114

0 commit comments

Comments
 (0)