Skip to content

Instantly share code, notes, and snippets.

@klondaiker
Last active May 17, 2022 13:35
Show Gist options
  • Save klondaiker/d582ec38c47ff45120f97e4e2150c28a to your computer and use it in GitHub Desktop.
Save klondaiker/d582ec38c47ff45120f97e4e2150c28a to your computer and use it in GitHub Desktop.
name: Rspec
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
env:
RAILS_ENV: test
DATABASE_HOST: 127.0.0.1
DATABASE_USER: postgres
DATABASE_PASS: postgres
REDIS_URL: redis://localhost:6379
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:13
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# required
POSTGRES_PASSWORD: postgres
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v2
with:
node-version: '12'
cache: 'yarn'
- run: yarn install
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.4
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Create database
run: |
bundle exec rake db:create db:migrate
bundle exec rails db:reset_openbill_triggers
- name: Run specs
run: bundle exec rspec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment