Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
rspec:
name: Rspec
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_HOST: 127.0.0.1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.2
- name: Install Dependencies
run: |
gem install bundler
bundle install
- name: Run Migrations
run: bundle exec rails db:create db:migrate RAILS_ENV=test
- name: Run Rspec
run: bundle exec rspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment