Skip to content

Merge pull request #11 from fabianoflorentino/development #39

Merge pull request #11 from fabianoflorentino/development

Merge pull request #11 from fabianoflorentino/development #39

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
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 }}
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: |
bundle exec rails db:migrate
- name: Run RSpec
run: bundle exec rspec