Skip to content

Commit

Permalink
Add unit test workflow configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianoflorentino committed Mar 3, 2024
1 parent d721e10 commit 02ec2c7
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Unit Tests

on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development

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
PGPASSFILE: /app/.pgpass
POSTGRES_PASSWORD: ephermeral_exists_during_tests
POSTGRES_USER: admin
POSTGRES_DB: blackpearl
POSTGRES_PORT: '5432'
POSTGRES_MAX_CONNECTIONS: '30'
POSTGRES_RANDOM_PAGE_COST: '1.1'
POSTGRES_EFFECTIVE_IO_CONCURRENCY: '30'
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: admin
POSTGRES_PASSWORD: ephermeral_exists_during_tests
POSTGRES_DB: blackpearl
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.0.0

- name: Bundle Install
run: bundle install

- name: Database Setup
run: bundle exec rails db:migrate

- name: Run RSpec
run: bundle exec rspec

0 comments on commit 02ec2c7

Please sign in to comment.