-
Notifications
You must be signed in to change notification settings - Fork 99
/
config.yml
103 lines (84 loc) · 2.62 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.7.4-node-browsers
environment: # environment variables for primary container
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
RAILS_ENV: test
RACK_ENV: test
DB_HOST: 127.0.0.1
DB_USERNAME: root
DB_PASSWORD: ''
DB_NAME: quepid
MYSQL_ALLOW_EMPTY_PASSWORD: true
- image: circleci/mysql:5.7
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
environment: # environment variables for database
MYSQL_DATABASE: quepid_test
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_ROOT_HOST: '%'
steps:
- checkout
- run:
name: Specify bundler!
command: gem install bundler:1.17.3
- run:
name: Which bundler?
command: bundle -v
# Restore bundle cache
- restore_cache:
keys:
- quepid-bundle-v2-{{ checksum "Gemfile.lock" }}
- quepid-bundle-v2-
- run:
name: Bundle Install
command: bundle check || bundle install
# Store bundle cache
- save_cache:
key: quepid-bundle-v2-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
keys:
- quepid-yarn-{{ checksum "yarn.lock" }}
- quepid-yarn-
- run:
name: Yarn Install
command: yarn install --cache-folder ~/.cache/yarn
# Store yarn / webpacker cache
- save_cache:
key: quepid-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Wait for DB
command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m
- run:
name: Unset DATABASE_URL
command: unset DATABASE_URL
- run:
name: Database setup
command: bundle exec rake db:setup --trace
- run:
name: Run unit tests (frontend)
command: bundle exec rake test:js
- run:
name: Run unit tests (backend)
command: bundle exec rake test
- run:
name: Run jshint
command: bundle exec rake test:jshint
- run:
name: Run rubocop
command: bundle exec rubocop
# Save test results for timing analysis
- store_test_results:
path: test/reports
# Save ruby code coverage metrics
- store_artifacts:
path: coverage