Closed cassiosantana closed 1 year ago
name: Run tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.2.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Setup test database
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
- name: Run tests
env:
RAILS_ENV: test
run: bundle exec rspec
The current GitHub Workflow configuration file (.yml) is set up for SQLite3. After changing our database to PostgreSQL, we need to update this configuration file so the test run will work correctly. This will involve modifying the database setup step and adding any necessary PostgreSQL dependencies.