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 387e5a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ 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
POSTGRES_DB: test
ports: ['5432:5432']

env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test

steps:
- uses: actions/checkout@v2
Expand All @@ -35,10 +33,6 @@ jobs:
bundle install --jobs 4 --retry 3
- name: Setup test database
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pages_ahead_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 387e5a9

Please sign in to comment.