-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (51 loc) · 1.26 KB
/
run_rspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
env:
# RUBY_VERSION: 3.0.1
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: storm_rails_tailwind_test
name: Rails Specs
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
rspec-test:
name: RSpec
runs-on: ubuntu-20.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: ruby/setup-ruby@v1
with:
bundler: default
bundler-cache: true
- name: Install postgres client
run: sudo apt-get install libpq-dev
- name: Install dependencies
run: |
gem install bundler
bundler install
- name: Linter Check
run: bundle exec rubocop
- 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 rspec spec/*
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: coverage-report
path: coverage