Move example app to specs #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RSpec | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432 | |
services: | |
postgres: | |
image: postgres:16.3 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: | |
--health-cmd="pg_isready" --health-interval=10s --health-timeout=5s | |
--health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Set up database | |
working-directory: spec/example | |
run: | | |
bin/rails db:create | |
bin/rails db:schema:load | |
- name: Run tests | |
run: bundle exec rspec |