Skip to content

Add pgcrypto extension and insert supervisor user into customers table #121

Add pgcrypto extension and insert supervisor user into customers table

Add pgcrypto extension and insert supervisor user into customers table #121

Workflow file for this run

---
name: RSpec
on:
push:
branches:
- main
- development
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
- '.github/**'
pull_request:
branches:
- main
- development
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
- '.github/**'
jobs:
rspec:
name: Unit Tests with RSepc
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
env:
RAILS_ENV: development
RAILS_MAX_THREADS: 2
WEB_CONCURRENCY: 2
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
POSTGRES_HOST: localhost
POSTGRES_PORT: '5432'
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: '5432'
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
PGPASSFILE: /app/.pgpass
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_MAX_CONNECTIONS: '30'
POSTGRES_RANDOM_PAGE_COST: '1.1'
POSTGRES_EFFECTIVE_IO_CONCURRENCY: '30'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dependences
run: |
sudo apt-get update -y
sudo apt-get install -y libpq-dev postgresql-client build-essential libssl-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
- name: Bundle Install
run: bundle install
- name: Database Setup
run: |
psql "postgresql://${{ secrets.POSTGRES_USER }}:${{ secrets.POSTGRES_PASSWORD }}@localhost:5432" << EOF
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
EOF
bundle exec rails db:migrate
- name: Run RSpec
run: bundle exec rspec