@@ -136,128 +136,7 @@ commands:
136
136
command : |
137
137
sudo apt-get install -y libvips-dev
138
138
139
- install_solidus :
140
- parameters :
141
- flags :
142
- type : string
143
- default : " # no options"
144
- description : " flags to be passed to `bin/rails g solidus:install"
145
- steps :
146
- - run :
147
- name : " Cleanup & check rails version"
148
- command : |
149
- sudo gem update --system
150
- gem install bundler -v"~> 2.4"
151
- gem environment path
152
- rm -rf /tmp/my_app /tmp/.ruby-versions # cleanup previous runs
153
- rm -rf /tmp/my_app /tmp/.gems-versions # cleanup previous runs
154
-
155
- ruby -v >> /tmp/.ruby-versions
156
- gem --version >> /tmp/.gems-versions
157
- bundle --version >> /tmp/.gems-versions
158
- gem search -eq rails -v "~> 7" -v "< 8.0" >> /tmp/.gems-versions # get the latest rails from rubygems
159
- gem search -eq solidus >> /tmp/.gems-versions # get the latest solidus from rubygems
160
-
161
- cat /tmp/.ruby-versions
162
- cat /tmp/.gems-versions
163
- - restore_cache :
164
- keys :
165
- - solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
166
- - solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-
167
- - run :
168
- name : " Prepare the rails application"
169
- command : |
170
- cd /tmp
171
- test -d my_app || (gem install rails -v "< 8.0" && gem install solidus)
172
- test -d my_app || rails new my_app --skip-git
173
- - save_cache :
174
- key : solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
175
- paths :
176
- - /tmp/my_app
177
- - /home/circleci/.rubygems
178
- - run :
179
- name : " Run `solidus:install` with `<<parameters.flags>>`"
180
- command : |
181
- cd /tmp/my_app
182
- bundle add solidus --path "$(ruby -e"puts File.expand_path ENV['CIRCLE_WORKING_DIRECTORY']")"
183
- unset RAILS_ENV # avoid doing everything on the test environment
184
- bin/rails generate solidus:install --auto-accept <<parameters.flags>>
185
-
186
- test_page :
187
- parameters :
188
- app_root :
189
- type : string
190
- default : " /tmp/my_app"
191
- path :
192
- type : string
193
- default : " /"
194
- expected_text :
195
- type : string
196
-
197
- steps :
198
- - run :
199
- name : " Check the contents of the <<parameters.path>> page"
200
- command : |
201
- cd <<parameters.app_root>>
202
- unset RAILS_ENV # avoid doing everything on the test environment
203
- bin/rails server -p 3000 &
204
- wget --quiet --output-document - --tries=30 --retry-connrefused "http://localhost:3000<<parameters.path>>" | grep "<<parameters.expected_text>>"
205
- echo "Exited with $?"
206
- kill $(cat "tmp/pids/server.pid")
207
-
208
- install_dummy_app :
209
- parameters :
210
- extra_gems :
211
- type : string
212
- default : " "
213
- description : " Gems to be added to the extension's Gemfile before running the installer"
214
- steps :
215
- - run :
216
- name : " Test `rake task: extensions:test_app` <<#parameters.extra_gems>>(with <<parameters.extra_gems>>)<</parameters.extra_gems>>"
217
- command : |
218
- rm -rf /tmp/dummy_extension # cleanup previous runs
219
- mkdir -p /tmp/dummy_extension
220
- cd /tmp/dummy_extension
221
- bundle init
222
- bundle add rails -v "< 8.1" --skip-install
223
- bundle add sqlite3 -v "~> 2.0" --skip-install
224
- test -n "<<parameters.extra_gems>>" && bundle add <<parameters.extra_gems>> --skip-install
225
- bundle add solidus --path "$(ruby -e"puts File.expand_path ENV['CIRCLE_WORKING_DIRECTORY']")"
226
- export LIB_NAME=set # dummy requireable file
227
- bundle exec rake -rrails -rspree/testing_support/extension_rake -e'Rake::Task["extension:test_app"].invoke'
228
-
229
139
jobs :
230
- solidus_installer :
231
- executor :
232
- name : sqlite
233
- ruby : " 3.1"
234
- steps :
235
- - checkout
236
- - run :
237
- name : " Skip for Solidus older than 4.2"
238
- command : |
239
- ruby -I. -rcore/lib/spree/core/version.rb -e "exit Spree.solidus_gem_version >= Gem::Version.new('4.2')" ||
240
- circleci-agent step halt
241
- - libvips
242
- - install_solidus :
243
- flags : " --sample=false --frontend=starter --authentication=devise"
244
- - test_page :
245
- expected_text : " <title>Sample Store</title>"
246
- - run :
247
- name : Ensure the correct PayPal is installed for SSF
248
- command : |
249
- cd /tmp/my_app
250
- bundle list | grep 'solidus_paypal_commerce_platform (1.'
251
- - install_solidus :
252
- flags : " --sample=false --frontend=starter --authentication=devise --payment-method=stripe"
253
- - test_page :
254
- expected_text : " <title>Sample Store</title>"
255
- - install_dummy_app
256
- - run :
257
- name : " Ensure extension test app is created"
258
- command : |
259
- test -d /tmp/dummy_extension/spec/dummy
260
-
261
140
test_solidus :
262
141
parameters :
263
142
database :
@@ -336,7 +215,6 @@ jobs:
336
215
workflows :
337
216
build :
338
217
jobs :
339
- - solidus_installer
340
218
- test_solidus_with_coverage # Only test with coverage support with the default versions
341
219
342
220
# Based on supported versions for the current Solidus release and recommended versions from
0 commit comments