Skip to content

feat: ✨ add seeds #30

feat: ✨ add seeds

feat: ✨ add seeds #30

Workflow file for this run

name: Run Tests
on: [push, pull_request]
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_DB: ruby-grape-clean-api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
strategy:
matrix:
node-version: [21]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Use Ruby 3.3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Clean Bundler cache
run: bundle clean --force
- name: Install dependencies
run: |
bundle install
npm ci # usa o package-lock.json para evitar problemas de cache
env:
NODE_ENV: test
- name: Run Migrations
run: bundle exec ruby ./src/main/config/migrations.rb
env:
DRIVER: postgres
POSTGRES_DB: ruby-grape-clean-api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run Seeds
run: bundle exec ruby ./src/infrastructure/db/seeds.rb
env:
DRIVER: postgres
POSTGRES_DB: ruby-grape-clean-api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run RSpec tests with coverage
run: COVERAGE=true bundle exec rspec --format documentation --color
env:
DRIVER: postgres
POSTGRES_DB: ruby-grape-clean-api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Run Coveralls
uses: coverallsapp/github-action@v2