-
Notifications
You must be signed in to change notification settings - Fork 15
54 lines (51 loc) · 1.27 KB
/
ruby.yml
File metadata and controls
54 lines (51 loc) · 1.27 KB
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
name: Ruby
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
ports: ['5432:5432']
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Gems cache
uses: actions/cache@v1
with:
path: ./vendor/bundle
key: gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
gem-
- name: Build and run tests
env:
RAILS_ENV: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
working-directory: ./src
run: |
sudo apt-get -yqq install libpq-dev
gem install bundler
bundle config path ../vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rails db:create
bundle exec rubocop
bundle exec rspec