Skip to content

Merge pull request #150 from CodeandoMexico/patch-149 #166

Merge pull request #150 from CodeandoMexico/patch-149

Merge pull request #150 from CodeandoMexico/patch-149 #166

name: StandadrdRb y RSpec
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
jobs:
standardrb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bin/standardrb --config .standard.yml
rspec:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.13.0
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Setup test database
env:
MAILER_SENDER: "homer.simpson@gmail.com"
DATABASE_URL: postgres://postgres:password@localhost:5432/decidim_monterrey_test
RAILS_ENV: test
run: |
bin/rails db:test:prepare
- name: Run tests
env:
MAILER_SENDER: "homer.simpson@gmail.com"
DATABASE_URL: postgres://postgres:password@localhost:5432/decidim_monterrey_test
RAILS_ENV: test
run: bin/rspec