File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 31
31
command : |
32
32
bundle install --jobs=4 --retry=3 --path vendor/bundle
33
33
34
+ - run :
35
+ name : Install Code Climate Test Reporter
36
+ command : |
37
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
38
+ chmod +x ./cc-test-reporter
39
+
34
40
- save_cache :
35
41
paths :
36
42
- ./vendor/bundle
@@ -51,16 +57,53 @@ jobs:
51
57
name : run tests
52
58
command : |
53
59
mkdir /tmp/test-results
60
+ ./cc-test-reporter before-build
54
61
TEST_FILES="$(circleci tests glob "spec/usage/**/*_spec.rb" | circleci tests split --split-by=timings)"
55
62
56
63
bundle exec rspec --format progress \
57
64
--out /tmp/test-results/rspec.xml \
58
65
--format progress \
59
66
$TEST_FILES
60
67
68
+ - run :
69
+ name : Code Climate Test Coverage
70
+ command : |
71
+ ./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
72
+ - persist_to_workspace :
73
+ root : coverage
74
+ paths :
75
+ - codeclimate.*.json
76
+
61
77
# collect reports
62
78
- store_test_results :
63
79
path : /tmp/test-results
64
80
- store_artifacts :
65
81
path : /tmp/test-results
66
82
destination : test-results
83
+
84
+ upload-coverage :
85
+ docker :
86
+ - image : circleci/ruby:2.5.1-stretch-node
87
+ environment :
88
+ CC_TEST_REPORTER_ID : 57123bd0e8b6c96bd254bf1fe46a5582250cd5e726ff639f85bfcd310f870f4a
89
+ working_directory : ~/repo
90
+
91
+ steps :
92
+ - run :
93
+ name : Install Code Climate Test Reporter
94
+ command : |
95
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
96
+ chmod +x ./cc-test-reporter
97
+ - run :
98
+ command : |
99
+ ./cc-test-reporter sum-coverage --output - codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
100
+
101
+ workflows :
102
+ version : 2
103
+
104
+ commit :
105
+ jobs :
106
+ - build
107
+ - upload-coverage :
108
+ requires :
109
+ - build
You can’t perform that action at this time.
0 commit comments