-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathconfig.yml
78 lines (65 loc) · 1.97 KB
/
config.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
version: 2.1
orbs:
rubocop: hanachin/rubocop@0.0.6
jobs:
build:
docker:
- image: circleci/<< parameters.ruby_version >>
- image: circleci/postgres:9.6.2-alpine
- image: circleci/mysql:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
parameters:
ruby_version:
type: string
gemfile:
type: string
environment:
BUNDLE_GEMFILE: << parameters.gemfile >>
steps:
- checkout
# Restore Cached Dependencies
# - restore_cache:
# keys:
# - gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
# - gem-cache-v1-{{ arch }}-{{ .Branch }}
# - gem-cache-v1
- run: bundle install --path vendor/bundle
# - save_cache:
# key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
# paths:
# - vendor/bundle
- run:
name: Install postgres client
command: sudo apt install -y postgresql-client
- run:
name: Install mysql client
command: sudo apt install -y default-mysql-client
- run:
name: Configure config database.yml
command: bundle exec rake db:copy_credentials
- run:
name: wait for postgresql
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: wait for mysql
command: dockerize -wait tcp://localhost:3306 -timeout 1m
- run:
name: Database Setup
command: |
bundle exec rake db:test:prepare
- run:
name: Run tests
command: bundle exec rspec
workflows:
tests:
jobs:
- build:
matrix:
parameters:
ruby_version: ["ruby:2.6-buster", "ruby:2.7-buster"]
gemfile: ["gemfiles/rails_5_2.gemfile", "gemfiles/rails_6_0.gemfile"]
rubocop:
jobs:
- rubocop/rubocop:
version: 0.88.0