-
Notifications
You must be signed in to change notification settings - Fork 10
/
circle.yml
66 lines (59 loc) · 1.57 KB
/
circle.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
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.6.5-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: rechord
RAILS_ENV: test
- image: circleci/postgres:10.1-alpine
environment:
POSTGRES_USER: rechord
POSTGRES_DB: rechord_test
POSTGRES_PASSWORD: ""
working_directory: ~/rechord
steps:
- checkout
# bundle
- run:
name: Which bundler?
command: bundle -v
- restore_cache:
keys:
- rails-demo-bundle-v3-{{ checksum "Gemfile.lock" }}
- run:
name: Bundle Install
command: bundle check || bundle install
- save_cache:
key: rails-demo-bundle-v3-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# yarn
- restore_cache:
keys:
- rails-demo-yarn-v2-{{ checksum "yarn.lock" }}
- rails-demo-yarn-v2-
- run:
name: yarn install
command: curl -o- -L https://yarnpkg.com/install.sh; yarn install
- save_cache:
key: rails-demo-yarn-v2-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
# database
- run:
name: Database setup
command: |
bin/rails db:create
bin/rails db:structure:load
# test
- run:
name: check lint
command: yarn lint
- run:
name: jest
command: yarn test