-
Notifications
You must be signed in to change notification settings - Fork 10
/
circle.yml
63 lines (52 loc) · 1.61 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
---
version: 2
jobs:
build:
working_directory: ~/your-app-name
docker:
- image: circleci/ruby:2.5.1-node-browsers
environment:
RAILS_ENV: test
RACK_ENV: test
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: dopay-payengine_test
steps:
- checkout
- run:
name: Create environment variables file
command: |
cp config/examples/application.yml config/application.yml
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Database setup
environment:
DATABASE_URL: 'postgres://postgres@localhost:5432/dopay-payengine_test'
command: |
bundle exec rake db:create db:schema:load --trace
bundle exec rake db:migrate
- run:
name: Rubocop
command: bundle exec rubocop
- run:
name: run tests
environment:
DATABASE_URL: 'postgres://postgres@localhost:5432/test_database_name'
command: |
mkdir /tmp/test-results
bundle exec rspec spec --format progress