1+ ---
2+
13version : 2.1
24
35defaults : &defaults
@@ -6,26 +8,26 @@ defaults: &defaults
68 - image : cimg/ruby:<< parameters.ruby-version >>
79
810orbs :
9- ruby : circleci/ruby@1.8 .0
11+ ruby : circleci/ruby@2.0 .0
1012
1113references :
12- restore_bundle_cache : &restore_bundle_cache
13- restore_cache :
14- keys :
15- - truemail-rspec-{{ checksum "truemail-rspec.gemspec" }}
16-
1714 bundle_install : &bundle_install
1815 run :
1916 name : Installing gems
2017 command : |
21- bundle config set --local path 'vendor/bundle'
18+ bundle config set --local path '~/ vendor/bundle'
2219 bundle install
2320
24- save_bundle_cache : &save_bundle_cache
25- save_cache :
26- key : truemail-rspec-{{ checksum "truemail-rspec.gemspec" }}
27- paths :
28- - vendor/bundle
21+ install_linters : &install_linters
22+ run :
23+ name : Installing bunch of linters
24+ command : |
25+ curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash
26+ sudo apt-get update -y
27+ sudo apt-get install -y lefthook shellcheck yamllint
28+ npm install --prefix='~/.local' --global --save-dev git+https://github.com/streetsidesoftware/cspell-cli markdownlint-cli
29+ cp .circleci/linter_configs/.fasterer.yml .fasterer.yml
30+ cp .circleci/linter_configs/.lefthook.yml lefthook.yml
2931
3032 install_codeclimate_reporter : &install_codeclimate_reporter
3133 run :
@@ -34,17 +36,20 @@ references:
3436 curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
3537 chmod +x ./cc-test-reporter
3638
39+ use_latest_bundler : &use_latest_bundler
40+ run :
41+ name : Using latest bundler
42+ command : gem install bundler
43+
3744 use_latest_gemspec : &use_latest_gemspec
3845 run :
3946 name : Using latest gemspec
40- command : |
41- cp .circleci/gemspec_latest truemail-rspec.gemspec
47+ command : cp .circleci/gemspecs/latest truemail-rspec.gemspec
4248
4349 use_compatible_gemspec : &use_compatible_gemspec
4450 run :
4551 name : Using compatible gemspec
46- command : |
47- cp .circleci/gemspec_compatible truemail-rspec.gemspec
52+ command : cp .circleci/gemspecs/compatible truemail-rspec.gemspec
4853
4954jobs :
5055 linters-ruby :
@@ -57,16 +62,30 @@ jobs:
5762 steps :
5863 - checkout
5964
65+ - << : *use_latest_bundler
6066 - << : *use_latest_gemspec
61- - << : *restore_bundle_cache
6267 - << : *bundle_install
63- - << : *save_bundle_cache
68+ - << : *install_linters
6469
6570 - run :
66- name : Running Overcommit
67- command : |
68- bundle exec overcommit -s
69- SKIP=AuthorEmail,AuthorName bundle exec overcommit -r
71+ name : Running code style linters
72+ command : lefthook run code-style-linters
73+
74+ - run :
75+ name : Running code performance linters
76+ command : lefthook run code-performance-linters
77+
78+ - run :
79+ name : Running code vulnerability linters
80+ command : lefthook run code-vulnerability-linters
81+
82+ - run :
83+ name : Running code documentation linters
84+ command : lefthook run code-documentation-linters
85+
86+ - run :
87+ name : Running release linters
88+ command : lefthook run release-linters
7089
7190 tests-ruby :
7291 parameters :
7897 steps :
7998 - checkout
8099
100+ - << : *use_latest_bundler
81101 - << : *use_latest_gemspec
82- - << : *restore_bundle_cache
83102 - << : *bundle_install
84- - << : *save_bundle_cache
85103 - << : *install_codeclimate_reporter
86104
87105 - run :
@@ -109,31 +127,83 @@ jobs:
109127 parameters :
110128 ruby-version :
111129 type : string
112- docker :
113- - image : cimg/ruby:<< parameters.ruby-version >>
130+
131+ << : *defaults
132+
114133 steps :
115134 - checkout
135+
116136 - << : *use_compatible_gemspec
137+
117138 - ruby/install-deps :
118- bundler-version : " 2.3.24 "
139+ bundler-version : " 2.3.26 "
119140 with-cache : false
120- path : ' ./vendor/custom_bundle'
141+ path : ' ~/vendor/custom_bundle'
142+
121143 - run :
122144 name : Running compatibility tests
123145 command : bundle exec rspec
124146
147+ rubygems-deps-ruby :
148+ parameters :
149+ ruby-version :
150+ type : string
151+
152+ << : *defaults
153+
154+ steps :
155+ - checkout
156+
157+ - run :
158+ name : Building rubygems dependencies from default gemspec on minimal Ruby version
159+ command : bundle install
160+
161+ releasing-gem-ruby :
162+ parameters :
163+ ruby-version :
164+ type : string
165+
166+ << : *defaults
167+
168+ steps :
169+ - checkout
170+
171+ - add_ssh_keys :
172+ fingerprints :
173+ - " 43:fb:a2:fc:4d:af:f3:c7:82:1d:16:ed:fa:76:23:0d"
174+
175+ - run :
176+ name : Publishing new release
177+ command : ./.circleci/scripts/release.sh
178+
125179workflows :
126- build_and_test :
180+ build_test_deploy :
127181 jobs :
128182 - linters-ruby :
129183 matrix :
130184 parameters :
131- ruby-version : ["3.1 "]
185+ ruby-version : ["3.2-node "]
132186 - tests-ruby :
133187 matrix :
134188 parameters :
135- ruby-version : ["3.1 "]
189+ ruby-version : ["3.2 "]
136190 - compatibility-ruby :
137191 matrix :
138192 parameters :
139- ruby-version : ["2.5", "2.6", "2.7", "3.0"]
193+ ruby-version : ["2.5", "2.6", "2.7", "3.0", "3.1"]
194+ - rubygems-deps-ruby :
195+ matrix :
196+ parameters :
197+ ruby-version : ["2.5"]
198+ - releasing-gem-ruby :
199+ requires :
200+ - linters-ruby
201+ - tests-ruby
202+ - compatibility-ruby
203+ - rubygems-deps-ruby
204+ matrix :
205+ parameters :
206+ ruby-version : ["2.5"]
207+ filters :
208+ branches :
209+ only : master
0 commit comments