-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (49 loc) · 1.34 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
---
name: ci
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: ruby
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('.tool-versions') }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ hashFiles('.tool-versions') }}-
- name: Install dependencies and run Rails 5 tests
run: |
cd spec/dummy-rails5
gem install bundler
bundle config path ../../vendor/bundle
bundle install --jobs 4 --retry 3
bin/rails db:migrate
bundle exec rspec spec/
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres