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