-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfig.yml
104 lines (90 loc) · 3.04 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
104
version: 2
jobs:
build:
parallelism: 1
docker:
- image: circleci/ruby:2.6.5-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
BUNDLER_VERSION: 2.0.2
PGHOST: 127.0.0.1
PGUSER: circleci-user
RAILS_ENV: test
DATABASE_URL: postgres://circleci-user@127.0.0.1/test_db
CC_TEST_REPORTER_ID: 3eb0a4ad46937f9c44053ed82830fde407b01e50d717bc6146a05a31753d718f
SELENIUM_REMOTE_HOST: localhost
- image: circleci/postgres:11.4-alpine
environment:
POSTGRES_USER: circleci-user
POSTGRES_DB: test_db
POSTGRES_PASSWORD: ""
- image: circleci/redis:5.0-alpine
- image: selenium/standalone-chrome
steps:
- checkout
# Install bundler
- run:
name: Install bundler
command: gem install bundler:2.0.2
# Which version of bundler?
- run:
name: Which bundler?
command: bundle -v
# Restore bundle cache
- restore_cache:
keys:
- bundle-v2-{{ checksum "Gemfile.lock" }}
- bundle-v2-
- run:
name: Bundle Install
command: bundle check || bundle install
# Store bundle cache
- save_cache:
key: bundle-v2-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# Only necessary if app uses webpacker or yarn in some other way
- restore_cache:
keys:
- yarn-{{ checksum "yarn.lock" }}
- yarn-
- run:
name: Yarn Install
command: yarn install
# Store yarn / webpacker cache
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.yarn-cache
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Database setup
command: bin/rails db:schema:load --trace
- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
# Run rspec in parallel
- type: shell
command: |
./cc-test-reporter before-build
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out test_results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
./cc-test-reporter format-coverage -t simplecov $CIRCLE_ARTIFACTS/coverage/.resultset.json
./cc-test-reporter upload-coverage
# Save test results for timing analysis
- store_test_results:
path: test_results
notify:
webhooks:
# A list of hook hashes, containing the url field
# gitter hook
- url: https://webhooks.gitter.im/e/445809b0130cf19eb31b