Skip to content

add readme specs

add readme specs #137

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
env:
RAILS_ENV: test
DATABASE_HOST: localhost
DATABASE_PORT: 5432
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.6
- name: Cache gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle install --path vendor/bundle
- name: Set up database
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
- name: add Outboxer
run: |
echo "gem 'outboxer', git: 'https://github.com/fast-programmer/outboxer.git', branch: 'master'" >> Gemfile
bundle install
bin/rails g outboxer:install
bin/rake db:migrate
mkdir lib
{ sed '$d' lib/event.rb; printf "\n # callbacks\n\n after_create do |event|\n Outboxer::Message.queue(messageable: event)\n end\nend\n"; } > lib/event.tmp && mv lib/event.tmp lib/event.rb
- name: Run tests
run: bundle exec rspec