-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.37 KB
/
ruby.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
name: Ruby
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.5
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Ruby version specified in `.ruby-version`
uses: eregon/use-ruby-action@master
- name: Install PostgreSQL client
run: |
sudo apt-get -yqq install libpq-dev
- name: Setup cache key and directory for gems cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-use-ruby-${{ hashFiles('**/Gemfile.lock') }}
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run migrations
env:
RAILS_ENV: test
RUBYOPT: -W0
run: |
cp config/database.yml.github config/database.yml
bundle exec rails db:reset db:setup db:migrate
- name: Run Rubocop
env:
RAILS_ENV: test
RUBYOPT: -W0
run: bundle exec rubocop --config .rubocop.yml
- name: Run tests with RSpec
env:
RAILS_ENV: test
RUBYOPT: -W0
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bundle exec rspec