diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 30b9997..eefea88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,11 +13,6 @@ jobs: env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 ports: - 5432 steps: @@ -26,8 +21,16 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - uses: ruby/setup-ruby@v1 - run: bundle install + - name: Wait until Postgres is ready to accept connections + run: | + apt-get update && apt-get install -f -y postgresql-client + 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 rake db:schema:load bundle exec rspec env: RAILS_ENV: test