Skip to content

Commit 5954ea9

Browse files
committed
Run the CI on all supported ruby versions
`solidus_bolt` needs to be disabled for the dummy app otherwise it fails due to the contrived nature of the app. For rubies < 3 using the latest rails we need to use the external net/http gem to avoid this error: rake aborted! LoadError: cannot load such file -- net/smtp /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require' /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require' /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency' /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require' /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/mail-2.7.1/lib/mail.rb:9:in `<module:Mail>' /home/circleci/project/vendor/bundle/v3.1/ruby/3.1.0/gems/mail-2.7.1/lib/mail.rb:3:in `<top (required)>' Ref rails/rails#44175 (comment)
1 parent bb291bd commit 5954ea9

3 files changed

Lines changed: 41 additions & 4 deletions

File tree

.circleci/config.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2.1
22

33
orbs:
4+
# Required for feature specs.
45
browser-tools: circleci/browser-tools@1.1
56

67
# Always take the latest version of the orb, this allows us to
@@ -11,21 +12,41 @@ orbs:
1112

1213
jobs:
1314
run-specs-with-postgres:
14-
executor: solidusio_extensions/postgres
15+
executor:
16+
name: solidusio_extensions/postgres
17+
ruby_version: '3.1'
1518
steps:
1619
- browser-tools/install-browser-tools
17-
- solidusio_extensions/run-tests
20+
- checkout
21+
- solidusio_extensions/run-tests-solidus-master
22+
- solidusio_extensions/store-test-results
1823
run-specs-with-mysql:
19-
executor: solidusio_extensions/mysql
24+
executor:
25+
name: solidusio_extensions/mysql
26+
ruby_version: '3.0'
2027
steps:
2128
- browser-tools/install-browser-tools
22-
- solidusio_extensions/run-tests
29+
- checkout
30+
- solidusio_extensions/run-tests-solidus-current
31+
- solidusio_extensions/store-test-results
32+
33+
run-specs-with-sqlite:
34+
executor:
35+
name: solidusio_extensions/sqlite
36+
ruby_version: '2.7'
37+
steps:
38+
- browser-tools/install-browser-tools
39+
- checkout
40+
- solidusio_extensions/run-tests-solidus-older
41+
- solidusio_extensions/store-test-results
42+
2343

2444
workflows:
2545
"Run specs on supported Solidus versions":
2646
jobs:
2747
- run-specs-with-postgres
2848
- run-specs-with-mysql
49+
- run-specs-with-sqlite
2950
"Weekly run specs against master":
3051
triggers:
3152
- schedule:
@@ -37,3 +58,4 @@ workflows:
3758
jobs:
3859
- run-specs-with-postgres
3960
- run-specs-with-mysql
61+
- run-specs-with-sqlite

Gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ end
3030

3131
gem 'rails-controller-testing', group: :test
3232

33+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
34+
# While we still support Ruby < 3 we need to workaround a limitation in
35+
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
36+
# resolve gems based on the required ruby version.
37+
gem 'async', '< 3', require: false
38+
39+
# 'net/smtp' is required by 'mail', see:
40+
# - https://github.com/ruby/net-protocol/issues/10
41+
# - https://stackoverflow.com/a/72474475
42+
gem 'net-smtp', require: false
43+
end
44+
3345
gemspec
3446

3547
# Use a local Gemfile to include development dependencies that might not be

Rakefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
# Don't build a dummy app with solidus_bolt enabled
4+
ENV['SKIP_SOLIDUS_BOLT'] = 'true'
5+
36
require 'bundler'
47
Bundler::GemHelper.install_tasks
58

0 commit comments

Comments
 (0)