From 7bd9b8d0b82dd50e83c370785d0072ef1a855b22 Mon Sep 17 00:00:00 2001 From: Matt Almeida <55164724+northeastprince@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:59:43 -0400 Subject: [PATCH] Don't wait for PG to be ready to progress in GH CI (#56) It takes around 10 seconds for Postgres to boot up, and the current buffer between when it's initialized and when it has to be ready is 30+ seconds, so we should be fine to shave off the time, but we can always add it back in if necessary. --- .github/workflows/ci.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da09b4ec..ee434b41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: ports: ["5432:5432"] env: POSTGRES_HOST_AUTH_METHOD: trust - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Checkout code uses: actions/checkout@v2 @@ -30,20 +29,14 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Setup Postgres - run: bundle exec rails db:create - env: - DATABASE_URL: postgresql://postgres@127.0.0.1:5432 - RAILS_ENV: test - - name: Update apt + - name: Install system dependencies env: DEBIAN_FRONTEND: noninteractive - run: sudo apt-get update -yqq - - name: Install libvips - env: - DEBIAN_FRONTEND: noninteractive - run: sudo apt-get install -yqq libvips + run: | + sudo apt-get update -yqq + sudo apt-get install -yqq libvips - name: Run tests - run: bundle exec rails test:all + run: bundle exec rails db:create test:all env: + RAILS_ENV: test DATABASE_URL: postgresql://postgres@127.0.0.1:5432