-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (61 loc) · 1.67 KB
/
quality.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
name: Quality
on:
pull_request:
push:
branches: [main]
jobs:
rubocop:
# Ruby static code analyzer and formatter
# https://github.com/rubocop/rubocop
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run RuboCop
run: bundle exec rubocop
erb-lint:
# ERB & HTML static code analyzer and formatter
# https://github.com/Shopify/erb-lint
name: ERB Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run ERB Lint
run: bundle exec erblint --lint-all --enable-all-linters
rspec:
name: RSpec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql user: test
postgresql password: password
- name: Build app
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:migrate RAILS_ENV=test
env:
DATABASE_URL: "postgres://test:password@localhost/application_test"
- name: Run RSpec
run: |
bundle exec rspec
env:
DATABASE_URL: "postgres://test:password@localhost/application_test"