fix(ci): use docker run instead of services for postgres
This commit is contained in:
+11
-15
@@ -29,16 +29,6 @@ jobs:
|
|||||||
integration:
|
integration:
|
||||||
name: "Integration tests"
|
name: "Integration tests"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:16
|
|
||||||
env:
|
|
||||||
POSTGRES_DB: polympr_test
|
|
||||||
POSTGRES_USER: test
|
|
||||||
POSTGRES_PASSWORD: test
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -50,16 +40,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
deno-version: v2.x
|
deno-version: v2.x
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Start postgres
|
||||||
run: npm install --ignore-scripts && deno install
|
|
||||||
|
|
||||||
- name: Wait for postgres
|
|
||||||
run: |
|
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..."
|
echo "Waiting for postgres..."
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install --ignore-scripts && deno install
|
||||||
|
|
||||||
- name: Apply migrations
|
- name: Apply migrations
|
||||||
env:
|
env:
|
||||||
POSTGRES_HOST: localhost
|
POSTGRES_HOST: localhost
|
||||||
|
|||||||
Reference in New Issue
Block a user