fix: start postgres and valkey via docker run in e2e to avoid service networking issues
This commit is contained in:
@@ -33,31 +33,24 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: ci
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_USER: lunarfront
|
||||
POSTGRES_PASSWORD: lunarfront
|
||||
POSTGRES_DB: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 5s
|
||||
--health-timeout 3s
|
||||
--health-retries 5
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:8
|
||||
options: >-
|
||||
--health-cmd "valkey-cli ping"
|
||||
--health-interval 5s
|
||||
--health-timeout 3s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Start services
|
||||
run: |
|
||||
docker run -d --name postgres \
|
||||
-e POSTGRES_USER=lunarfront \
|
||||
-e POSTGRES_PASSWORD=lunarfront \
|
||||
-e POSTGRES_DB=postgres \
|
||||
-p 5432:5432 \
|
||||
postgres:16
|
||||
docker run -d --name valkey \
|
||||
-p 6379:6379 \
|
||||
valkey/valkey:8
|
||||
until docker exec postgres pg_isready -U lunarfront; do sleep 1; done
|
||||
until docker exec valkey valkey-cli ping; do sleep 1; done
|
||||
|
||||
- name: Install Bun
|
||||
run: |
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
@@ -69,3 +62,9 @@ jobs:
|
||||
- name: Run API tests
|
||||
working-directory: packages/backend
|
||||
run: bun run api-test
|
||||
|
||||
- name: Stop services
|
||||
if: always()
|
||||
run: |
|
||||
docker stop postgres valkey || true
|
||||
docker rm postgres valkey || true
|
||||
|
||||
Reference in New Issue
Block a user