Skip to content

Commit

Permalink
work on db issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeheft committed Jul 7, 2024
1 parent f96bf8d commit 7c3772d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
18 changes: 5 additions & 13 deletions .github/actions/run_rspec/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,23 @@ runs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}

- name: Install dependencies
shell: bash
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Setup PostgreSQL
shell: bash
run: |
docker run --name postgres-db -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD="${{ inputs.postgres-password }}" -d postgres:16.1
- name: Setup Redis
shell: bash
run: |
docker run --name redis-server -p 6379:6379 -d redis
- name: "Setup DB, Run tests"
- name: Setup DB and Run Tests
shell: bash
env:
PGHOST: 127.0.0.1
PGUSER: route_rater
PGHOST: localhost
PGUSER: postgres
PGPORT: 5432
PGPASSWORD: ${{ inputs.postgres-password }}
REDIS_URL: redis://localhost:6379/1
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/rspec_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ jobs:

if: github.ref != 'refs/heads/main'

services:
postgres:
image: postgres:16.1
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{ secrets.ROUTE_RATER_DATABASE_PASSWORD }}
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

redis:
image: redis
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Run RSpec
Expand Down

0 comments on commit 7c3772d

Please sign in to comment.