Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 1 addition & 45 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,4 @@ permissions:

jobs:
rspec:
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
rails-version:
- "7.1"
- "7.2"
- "8.0"
ruby-version:
- "3.1"
- "3.4"
solidus-branch:
- "v4.3"
- "v4.4"
- "v4.5"
- "main"
database:
- "postgresql"
- "mysql"
- "sqlite"
exclude:
- rails-version: "7.2"
solidus-branch: "v4.3"
- ruby-version: "3.1"
rails-version: "8.0"
- solidus-branch: "v4.3"
rails-version: "8.0"
- solidus-branch: "v4.4"
rails-version: "8.0"
steps:
- uses: actions/checkout@v4
- name: Run extension tests
uses: solidusio/test-solidus-extension@main
with:
database: ${{ matrix.database }}
rails-version: ${{ matrix.rails-version }}
ruby-version: ${{ matrix.ruby-version }}
solidus-branch: ${{ matrix.solidus-branch }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.xml
uses: solidusio/test-solidus-extension/.github/workflows/test.yml@main
1 change: 1 addition & 0 deletions lib/solidus_dev_support/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
module SolidusDevSupport
class Extension < Thor
include Thor::Actions

PREFIX = "solidus_"

default_command :generate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,11 @@ on:
pull_request:
schedule:
- cron: "0 0 * * 4" # every Thursday

concurrency:
group: test-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
workflow_call:

permissions:
contents: read

jobs:
rspec:
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
rails-version:
- "7.0"
- "7.1"
- "7.2"
ruby-version:
- "3.1"
- "3.4"
solidus-branch:
- "v4.1"
- "v4.2"
- "v4.3"
- "v4.4"
- "v4.5"
database:
- "postgresql"
- "mysql"
- "sqlite"
exclude:
- rails-version: "7.2"
solidus-branch: "v4.3"
- rails-version: "7.2"
solidus-branch: "v4.2"
- rails-version: "7.2"
solidus-branch: "v4.1"
- rails-version: "7.1"
solidus-branch: "v4.2"
- rails-version: "7.1"
solidus-branch: "v4.1"
- ruby-version: "3.4"
rails-version: "7.0"
env:
CODECOV_COVERAGE_PATH: ./coverage/coverage.xml
steps:
- uses: actions/checkout@v4
- name: Run extension tests
uses: solidusio/test-solidus-extension@main
with:
database: ${{ matrix.database }}
rails-version: ${{ matrix.rails-version }}
ruby-version: ${{ matrix.ruby-version }}
solidus-branch: ${{ matrix.solidus-branch }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.CODECOV_COVERAGE_PATH }}
uses: solidusio/test-solidus-extension/.github/workflows/test.yml@main
7 changes: 4 additions & 3 deletions lib/solidus_dev_support/templates/extension/Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
gem 'solidus', github: 'solidusio/solidus', branch: branch

# The solidus_frontend gem has been pulled out since v3.2
if branch >= 'v3.2'
gem 'solidus_frontend'
elsif branch == 'main'
if branch == 'main' || branch >= 'v3.2'
gem 'solidus_frontend', github: 'solidusio/solidus_frontend'
else
gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch
Expand All @@ -18,6 +16,9 @@ end
rails_version = ENV.fetch('RAILS_VERSION', '7.0')
gem 'rails', "~> #{rails_version}"

# ActiveSupport < 8.1 passes quirks_mode to JSON.generate, which json 3 rejects.
gem 'json', '< 3' if Gem::Version.new(rails_version) < Gem::Version.new('8.1')

case ENV.fetch('DB', nil)
when 'mysql'
gem 'mysql2'
Expand Down
3 changes: 3 additions & 0 deletions lib/solidus_dev_support/templates/extension/bin/sandbox.tt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ gem 'solidus_auth_devise'

gem '$extension_name', path: '..'

# ActiveSupport < 8.1 passes quirks_mode to JSON.generate, which json 3 rejects.
gem 'json', '< 3' if Gem::Version.new('$rails_version') < Gem::Version.new('8.1')

group :test, :development do
platforms :mri do
gem 'pry-byebug'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.metadata['source_code_uri'] = '<%= gemspec.metadata["source_code_uri"] %>'
spec.metadata['changelog_uri'] = '<%= gemspec.metadata["changelog_uri"] %>'

spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 4')
spec.required_ruby_version = Gem::Requirement.new('>= 3.3', '< 5')

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand Down
2 changes: 1 addition & 1 deletion spec/features/create_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def check_run_specs

def check_sandbox
cd(install_path) do
command = 'bin/rails-sandbox runner "puts %{The version of SolidusTestExtension is #{SolidusTestExtension::VERSION}}"'
command = %(bin/rails-sandbox runner "puts %{The version of SolidusTestExtension is #{SolidusTestExtension::VERSION}}")

first_run_output = sh(command)
expect(first_run_output).to include("Creating the sandbox app...")
Expand Down
Loading