1
1
version : 2.1
2
+
3
+ env-vars : &env-vars
4
+ RAILS_ENV : test
5
+ NODE_ENV : test
6
+ BUNDLE_PATH : vendor/bundle
7
+ SPROCKETS : false
8
+
2
9
orbs :
3
10
4
11
browser-tools :
circleci/[email protected]
5
- jobs :
6
- test :
12
+
13
+ executors :
14
+ main-executor :
7
15
parameters :
8
16
ruby-version :
17
+ description : " Ruby version"
18
+ default : " 2.7"
9
19
type : string
10
20
docker :
11
- - image : circleci/ruby:<< parameters.ruby-version >>-node
12
- environment :
13
- RAILS_ENV : test
14
- NODE_ENV : test
15
- BUNDLE_PATH : vendor/bundle
16
- SPROCKETS : false
17
- executor : ruby/default
21
+ - image : circleci/ruby:<<parameters.ruby-version>>-node
22
+ environment : *env-vars
23
+
24
+ commands :
25
+ setup :
26
+ description : checkout code, restore cache, install dependencies, save cache
18
27
steps :
19
28
- checkout
20
29
- browser-tools/install-chrome
41
50
command : |
42
51
bundle exec rake prepare_assets
43
52
(cd spec/dummy && bundle exec rake webpacker:compile)
53
+
54
+ jobs :
55
+ lint :
56
+ executor : main-executor
57
+ steps :
58
+ - setup
44
59
- run :
45
- name : Utils Tests
60
+ name : Install reviewdog
61
+ command : |
62
+ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
63
+ - run :
64
+ name : Get files to lint
65
+ command : git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
66
+ - run :
67
+ name : Run rubocop
68
+ shell : /bin/bash
69
+ command : |
70
+ cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
71
+ | ./bin/reviewdog -reporter=github-pr-review -f=rubocop
72
+ test :
73
+ parameters :
74
+ ruby-version :
75
+ description : " Ruby version"
76
+ default : " 2.7"
77
+ type : string
78
+ executor :
79
+ name : main-executor
80
+ ruby-version : <<parameters.ruby-version>>
81
+ steps :
82
+ - setup
83
+ - run :
84
+ name : Run Utils Tests
46
85
command : |
47
86
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/utils-rspec.xml"
48
87
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
@@ -63,10 +102,13 @@ jobs:
63
102
bundle exec rspec ./spec/features $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
64
103
- store_test_results :
65
104
path : test_results
105
+
66
106
workflows :
67
107
version : 2
68
- test :
108
+ test_and_lint :
69
109
jobs :
110
+ - lint :
111
+ context : org-global
70
112
- test :
71
113
matrix :
72
114
parameters :
0 commit comments