Skip to content

Commit

Permalink
chore: Update test DB configuration for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiosantana committed Aug 29, 2023
1 parent e9f0877 commit 42d9904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@ jobs:
runs-on: ubuntu-latest

services:
postgres:
db:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_DB: pages_ahead_test
options: >-
--health-cmd pg_isreadydb_test
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
Expand All @@ -37,8 +30,7 @@ jobs:
- name: Setup test database
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pages_ahead_test

DATABASE_URL: postgres://postgres:postgres@db:5432/test
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
Expand Down
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
url: <%= ENV['DATABASE_URL'] %>

development:
<<: *default
Expand Down

0 comments on commit 42d9904

Please sign in to comment.