Skip to content

Commit

Permalink
Rewritten waiting for dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarhiievHE committed Dec 30, 2023
1 parent 3199372 commit 28f4aa9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,24 @@ jobs:
if: runner.os != 'windows'
run: |
docker-compose -f test-docker-compose.yml up -d pg-example redis-example
sleep 15 # wait for database to be ready
docker ps
# sleep 15 # wait for database to be ready
# docker ps
- name: Wait for PostgreSQL to become healthy
run: |
while [[ "$(docker inspect --format='{{.State.Health.Status}}' postgres)" != "healthy" ]]; do
echo "Waiting for PostgreSQL container to become healthy..."
sleep 5
done
timeout-minutes: 5

- name: Wait for Redis to become healthy
run: |
while [[ "$(docker inspect --format='{{.State.Health.Status}}' redis-example)" != "healthy" ]]; do
echo "Waiting for Redis container to become healthy..."
sleep 5
done
timeout-minutes: 5

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
Expand All @@ -96,3 +112,6 @@ jobs:
- run: npm run dotest
env:
MODE: test

- name: Stop containers
run: docker-compose down

0 comments on commit 28f4aa9

Please sign in to comment.