forked from houndci/hound
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircle.yml
75 lines (61 loc) · 2.31 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
67
68
69
70
71
72
73
74
75
version: 2
jobs:
build:
working_directory: ~/hound
docker:
- image: circleci/ruby:2.3-node
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:3.2.10-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" }}
- type: cache-restore
name: Restore apt cache
key: houndci-apt-{{ checksum "Gemfile.lock" }}
# Install System Dependencies from cache (for capybara-webkit)
- run: sudo dpkg -i /home/circleci/.cache/apt/archives/*.deb || true
# Install System Dependencies (for capybara-webkit)
- run: mkdir -p /home/circleci/.cache/apt/archives/partial && touch /home/circleci/.cache/apt/archives/lock && chmod 640 /home/circleci/.cache/apt/archives/lock && sudo apt-get install -o=dir::cache=/home/circleci/.cache/apt qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
# 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
- type: cache-save
name: Store apt cache
key: houndci-apt-{{ checksum "Gemfile.lock" }}
paths:
- ~/.cache/apt
# 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