Skip to content

Commit c087c18

Browse files
committed
Add CircleCI config
1 parent cc28cf4 commit c087c18

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.circleci/config.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Ruby CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/ruby:2.4.1-node-browsers
11+
environment:
12+
STEALTH_ENV: test
13+
14+
# Specify service dependencies here if necessary
15+
# CircleCI maintains a library of pre-built images
16+
# documented at https://circleci.com/docs/2.0/circleci-images/
17+
# - image: circleci/postgres:9.4
18+
19+
working_directory: ~/repo
20+
21+
steps:
22+
- checkout
23+
24+
# Download and cache dependencies
25+
- restore_cache:
26+
keys:
27+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
28+
# fallback to using the latest cache if no exact match is found
29+
- v1-dependencies-
30+
31+
- run:
32+
name: install dependencies
33+
command: |
34+
bundle install --jobs=4 --retry=3 --path vendor/bundle
35+
36+
- save_cache:
37+
paths:
38+
- ./vendor/bundle
39+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
40+
41+
# run tests!
42+
- run:
43+
name: run tests
44+
command: |
45+
mkdir /tmp/test-results
46+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
47+
48+
bundle exec rspec --format progress \
49+
--format RspecJunitFormatter \
50+
--out /tmp/test-results/rspec.xml \
51+
--format progress \
52+
-- \
53+
$TEST_FILES
54+
55+
# collect reports
56+
- store_test_results:
57+
path: /tmp/test-results
58+
- store_artifacts:
59+
path: /tmp/test-results
60+
destination: test-results

0 commit comments

Comments
 (0)