fix(ci): use docker run instead of services for postgres
This commit is contained in:
+11
-15
@@ -29,16 +29,6 @@ jobs:
|
||||
integration:
|
||||
name: "Integration tests"
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_DB: polympr_test
|
||||
POSTGRES_USER: test
|
||||
POSTGRES_PASSWORD: test
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -50,16 +40,22 @@ jobs:
|
||||
with:
|
||||
deno-version: v2.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install --ignore-scripts && deno install
|
||||
|
||||
- name: Wait for postgres
|
||||
- name: Start postgres
|
||||
run: |
|
||||
until bash -c 'echo > /dev/tcp/localhost/5432' 2>/dev/null; do
|
||||
docker run -d --name postgres \
|
||||
-e POSTGRES_DB=polympr_test \
|
||||
-e POSTGRES_USER=test \
|
||||
-e POSTGRES_PASSWORD=test \
|
||||
-p 5432:5432 \
|
||||
postgres:16
|
||||
until docker exec postgres pg_isready -U test; do
|
||||
echo "Waiting for postgres..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install --ignore-scripts && deno install
|
||||
|
||||
- name: Apply migrations
|
||||
env:
|
||||
POSTGRES_HOST: localhost
|
||||
|
||||
Reference in New Issue
Block a user