File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 63
63
test :
64
64
runs-on : ubuntu-latest
65
65
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
+
66
89
steps :
67
90
- uses : actions/checkout@v4
68
91
@@ -80,6 +103,12 @@ jobs:
80
103
- name : Install Dependencies
81
104
run : bun install
82
105
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
+
83
112
- name : Unit Test
84
113
run : bun test
85
114
You can’t perform that action at this time.
0 commit comments