-
Notifications
You must be signed in to change notification settings - Fork 401
/
circle.yml
59 lines (49 loc) · 1.54 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
version: 2
jobs:
build:
working_directory: ~/hound
docker:
- image: circleci/ruby:2.7.1-node-browsers
environment:
RAILS_ENV: test
CIRCLECI: true
PGHOST: 127.0.0.1
PGUSER: houndci
- image: circleci/postgres:9.5-alpine
environment:
POSTGRES_USER: houndci
POSTGRES_DB: houndci-test
POSTGRES_PASSWORD: ""
- image: redis:5.0.7-alpine
steps:
- checkout
- type: cache-restore
name: Restore bundle cache
key: houndci-{{ checksum "Gemfile.lock" }}
- type: cache-restore
name: Restore yarn cache
key: houndci-yarn-{{ checksum "yarn.lock" }}
# Bundle install dependencies
- run: bundle install --path vendor/bundle
# Yarn install
- run: yarn config set yarn-offline-mirror ~/.cache/yarn && yarn install
- type: cache-save
name: Store bundle cache
key: houndci-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- type: cache-save
name: Store yarn cache
key: houndci-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
# Wait for DB
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
# Wait for Redis
- run: dockerize -wait tcp://localhost:6379 -timeout 1m
# Database setup
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load
# Run rspec in parallel
- type: shell
command: xvfb-run --auto-servernum bundle exec rake