Merge branch 'development' into dependabot/bundler/rails-html-sanitiz… #122
Workflow file for this run
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
env: | |
RUBY_VERSION: 2.4 | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
name: Rails tests | |
on: [push,pull_request] | |
jobs: | |
rubocop-test: | |
name: Rubocop | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
- name: Install Rubocop | |
run: gem install rubocop | |
- name: Check code | |
run: rubocop | |
rspec-test: | |
name: RSpec | |
needs: rubocop-test | |
runs-on: ubuntu-18.04 | |
services: | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
- name: Install postgres client | |
run: sudo apt-get install libpq-dev | |
- name: Install dependencies | |
run: | | |
gem install bundler | |
bundler install | |
- name: Create database | |
run: | | |
bundler exec rails db:create RAILS_ENV=test | |
bundler exec rails db:migrate RAILS_ENV=test | |
- name: Run tests | |
run: bundler exec rake | |
- name: Upload coverage results | |
uses: actions/upload-artifact@master | |
if: always() | |
with: | |
name: coverage-report | |
path: coverage |