Skip to content
Merged
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
63 changes: 0 additions & 63 deletions .circleci/config.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on: [pull_request]

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

permissions:
contents: read

jobs:
ruby:
name: Check Ruby
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Lint Ruby files
run: bundle exec rubocop -ESP
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 4" # every Thursday

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

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.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
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ gemspec
branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
gem 'solidus', github: 'solidusio/solidus', branch: branch

rails_version = ENV.fetch("RAILS_VERSION", "~> 7.0")
gem 'rails', rails_version
rails_version = ENV.fetch("RAILS_VERSION", "7.0")
gem 'rails', "~> #{rails_version}"

gem 'bundler'
gem 'rake'
Expand All @@ -21,13 +21,13 @@ group :test do
gem 'mysql2'
gem 'pg'
gem 'solidus_auth_devise'
gem 'sqlite3', rails_version < '~> 7.2' ? '~> 1.4' : '~> 2.0'
gem 'sqlite3', rails_version < '7.2' ? '~> 1.4' : '~> 2.0'
end

# Use a local Gemfile to include development dependencies that might not be
# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
eval_gemfile 'Gemfile-local' if File.exist? 'Gemfile-local'

if rails_version == "~> 7.0"
if rails_version == "7.0"
gem 'concurrent-ruby', '< 1.3.5'
end
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# solidus_dev_support


[![CircleCI](https://circleci.com/gh/solidusio/solidus_dev_support.svg?style=shield)](https://circleci.com/gh/solidusio/solidus_dev_support)
[![Test](https://github.com/solidusio/solidus_dev_support/actions/workflows/test.yml/badge.svg)](https://github.com/solidusio/solidus_dev_support/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/solidusio/solidus_dev_support/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus_dev_support)

This gem contains common development functionality for Solidus extensions.
Expand Down Expand Up @@ -138,15 +138,10 @@ require 'solidus_dev_support/rspec/coverage'
**Note: Make sure to add this at the VERY TOP of your spec_helper, otherwise you'll get skewed
coverage reports!**

If your extension is in a public repo and being tested on Travis or CircleCI, there's nothing else
If your extension is in a public repo and being tested on GitHub actions, there's nothing else
you need to do! If your setup is more complex, look at the
[SimpleCov](https://github.com/colszowka/simplecov)
and [codecov-ruby](https://github.com/codecov/codecov-ruby) docs.

> [!WARNING]
> The Codecov ruby uploader is deprecated.
> Please use the Codecov CLI uploader to upload code coverage reports.
> See https://docs.codecov.com/docs/deprecated-uploader-migration-guide#ruby-uploader for more information on upgrading.
and [codecov](https://about.codecov.io/language/ruby/) docs.

#### Using GitHub Actions

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on: [pull_request]

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

permissions:
contents: read

jobs:
ruby:
name: Check Ruby
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- name: Lint Ruby files
run: bundle exec rubocop -ESP
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 4" # every Thursday

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

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 }}
13 changes: 9 additions & 4 deletions lib/solidus_dev_support/templates/extension/Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,27 @@ else
gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch
end

rails_version = ENV.fetch('RAILS_VERSION', '~> 7.0')
gem 'rails', rails_version
rails_version = ENV.fetch('RAILS_VERSION', '7.0')
gem 'rails', "~> #{rails_version}"

case ENV.fetch('DB', nil)
when 'mysql'
gem 'mysql2'
when 'postgresql'
gem 'pg'
else
gem 'sqlite3', rails_version < '~> 7.2' ? '~> 1.4' : '~> 2.0'
gem 'sqlite3', rails_version < '7.2' ? '~> 1.4' : '~> 2.0'
end

if rails_version == '~> 7.0'
if rails_version == '7.0'
gem 'concurrent-ruby', '< 1.3.5'
end

if RUBY_VERSION >= '3.4'
# Solidus Promotions uses CSV but does not have it as dependency yet.
gem 'csv'
end

# While we still support Ruby < 3 we need to workaround a limitation in
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
# resolve gems based on the required ruby version.
Expand Down
8 changes: 8 additions & 0 deletions lib/solidus_dev_support/templates/extension/bin/sandbox.tt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ group :test, :development do
end
RUBY

echo "Generating manifest file"
mkdir -p app/assets/config
cat <<MANIFESTJS > app/assets/config/manifest.js
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
MANIFESTJS

unbundled bundle install --gemfile Gemfile

unbundled bundle exec rake db:drop db:create
Expand Down