From eade9f031890c84ef741ddd605290c1942fca20c Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Tue, 30 Jul 2024 21:30:16 +0200 Subject: [PATCH] Explicitly wait for Postgres to be ready to accept connections --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 30b9997..8341f66 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,13 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1 - run: bundle install + - name: Wait until Postgres is ready to accept connections + run: | + until pg_isready -h postgres -U postgres -d postgres + do + sleep 1 + echo "Trying again" + done - run: | bundle exec rake db:create db:schema:load bundle exec rspec