-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Tapia
committed
Jul 8, 2023
1 parent
e9d72f0
commit b2f0ccb
Showing
23 changed files
with
278 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,52 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
# Required for feature specs. | ||
browser-tools: circleci/[email protected] | ||
|
||
# Always take the latest version of the orb, this allows us to | ||
# run specs against Solidus supported versions only without the need | ||
# to change this configuration every time a Solidus version is released | ||
# or goes EOL. | ||
solidusio_extensions: solidusio/extensions@volatile | ||
|
||
jobs: | ||
run-specs-with-sqlite: | ||
executor: | ||
name: solidusio_extensions/sqlite | ||
ruby_version: "3.0" | ||
steps: | ||
- browser-tools/install-chrome | ||
- solidusio_extensions/run-tests | ||
run-specs-with-postgres: | ||
executor: solidusio_extensions/postgres | ||
executor: | ||
name: solidusio_extensions/postgres | ||
ruby_version: "3.0" | ||
steps: | ||
- browser-tools/install-chrome | ||
- solidusio_extensions/run-tests | ||
run-specs-with-mysql: | ||
executor: solidusio_extensions/mysql | ||
executor: | ||
name: solidusio_extensions/mysql | ||
ruby_version: "3.0" | ||
steps: | ||
- browser-tools/install-chrome | ||
- solidusio_extensions/run-tests | ||
lint-code: | ||
executor: | ||
name: solidusio_extensions/sqlite-memory | ||
ruby_version: "3.0" | ||
steps: | ||
- solidusio_extensions/lint-code | ||
|
||
workflows: | ||
"Run specs on supported Solidus versions": | ||
jobs: | ||
- run-specs-with-sqlite | ||
- run-specs-with-postgres | ||
- run-specs-with-mysql | ||
- lint-code | ||
|
||
"Weekly run specs against master": | ||
triggers: | ||
- schedule: | ||
|
@@ -31,5 +56,6 @@ workflows: | |
only: | ||
- master | ||
jobs: | ||
- run-specs-with-sqlite | ||
- run-specs-with-postgres | ||
- run-specs-with-mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 60 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
# Label to use when marking an issue as stale | ||
staleLabel: wontfix | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false | ||
_extends: .github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
issues=false | ||
exclude-labels=infrastructure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,8 @@ pkg | |
*.swp | ||
spec/dummy | ||
spec/examples.txt | ||
Gemfile-local | ||
/sandbox | ||
.rvmrc | ||
.ruby-version | ||
.ruby-gemset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
require: | ||
- solidus_dev_support/rubocop | ||
|
||
inherit_gem: | ||
solidus_dev_support: .rubocop.yml | ||
|
||
AllCops: | ||
Exclude: | ||
- spec/dummy/**/* | ||
- vendor/**/* | ||
|
||
Rails/SkipsModelValidations: | ||
Exclude: | ||
- db/migrate/**/* | ||
NewCops: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Rails/HasManyOrHasOneDependent: | ||
Enabled: false | ||
|
||
Rails/CreateTableWithTimestamps: | ||
Enabled: false | ||
|
||
Layout/ArgumentAlignment: | ||
Enabled: false | ||
|
||
Gemspec/RequiredRubyVersion: | ||
Enabled: false | ||
|
||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
|
||
RSpec/LetSetup: | ||
Enabled: false | ||
|
||
Layout/HashAlignment: | ||
Enabled: false | ||
|
||
RSpec/NamedSubject: | ||
Enabled: false | ||
|
||
RSpec/HookArgument: | ||
Enabled: false | ||
|
||
Rails/ApplicationJob: | ||
Enabled: false | ||
|
||
RSpec/DescribeClass: | ||
Enabled: false | ||
|
||
RSpec/ContextWording: | ||
Enabled: false | ||
|
||
Rails/SkipsModelValidations: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/gem_tasks' | ||
require 'solidus_dev_support/rake_tasks' | ||
SolidusDevSupport::RakeTasks.install | ||
|
||
task default: %w[extension:test_app extension:specs] | ||
task default: 'extension:specs' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# frozen_string_literal: true | ||
|
||
app_root = 'spec/dummy' | ||
#!/usr/bin/env ruby | ||
|
||
unless File.exist? "#{app_root}/bin/rails" | ||
system "bin/rake", app_root or begin # rubocop:disable Style/AndOr | ||
warn "Automatic creation of the dummy app failed" | ||
exit 1 | ||
end | ||
if %w[g generate].include? ARGV.first | ||
exec "#{__dir__}/rails-engine", *ARGV | ||
else | ||
exec "#{__dir__}/rails-sandbox", *ARGV | ||
end | ||
|
||
Dir.chdir app_root | ||
exec 'bin/rails', *ARGV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails gems | ||
# installed from the root of your application. | ||
|
||
ENGINE_ROOT = File.expand_path('..', __dir__) | ||
ENGINE_PATH = File.expand_path('../lib/solidus_slider/engine', __dir__) | ||
|
||
# Set up gems listed in the Gemfile. | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) | ||
|
||
require 'rails/all' | ||
require 'rails/engine/commands' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
#!/usr/bin/env ruby | ||
|
||
app_root = 'sandbox' | ||
|
||
unless File.exist? "#{app_root}/bin/rails" | ||
warn 'Creating the sandbox app...' | ||
Dir.chdir "#{__dir__}/.." do | ||
system "#{__dir__}/sandbox" or begin | ||
warn 'Automatic creation of the sandbox app failed' | ||
exit 1 | ||
end | ||
end | ||
end | ||
|
||
Dir.chdir app_root | ||
exec 'bin/rails', *ARGV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
|
||
load Gem.bin_path('rake', 'rake') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# frozen_string_literal: true | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -e | ||
test -z "${DEBUG+empty_string}" || set -x | ||
|
||
test "$DB" = "sqlite" && export DB="sqlite3" | ||
|
||
if [ -z "$SOLIDUS_BRANCH" ] | ||
then | ||
echo "~~> Use 'export SOLIDUS_BRANCH=[main|v3.2|...]' to control the Solidus branch" | ||
SOLIDUS_BRANCH="main" | ||
fi | ||
echo "~~> Using branch $SOLIDUS_BRANCH of solidus" | ||
|
||
if [ -z "$SOLIDUS_FRONTEND" ] | ||
then | ||
echo "~~> Use 'export SOLIDUS_FRONTEND=[solidus_frontend|solidus_starter_frontend]' to control the Solidus frontend" | ||
SOLIDUS_FRONTEND="solidus_frontend" | ||
fi | ||
echo "~~> Using branch $SOLIDUS_FRONTEND as the solidus frontend" | ||
|
||
extension_name="solidus_abandoned_carts" | ||
|
||
# Stay away from the bundler env of the containing extension. | ||
function unbundled { | ||
ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- $@ | ||
} | ||
|
||
rm -rf ./sandbox | ||
unbundled bundle exec rails new sandbox \ | ||
--database="${DB:-sqlite3}" \ | ||
--skip-bundle \ | ||
--skip-git \ | ||
--skip-keeps \ | ||
--skip-rc \ | ||
--skip-spring \ | ||
--skip-test \ | ||
--skip-javascript | ||
|
||
if [ ! -d "sandbox" ]; then | ||
echo 'sandbox rails application failed' | ||
exit 1 | ||
fi | ||
|
||
cd ./sandbox | ||
cat <<RUBY >> Gemfile | ||
gem 'solidus', github: 'solidusio/solidus', branch: '$SOLIDUS_BRANCH' | ||
gem 'rails-i18n' | ||
gem 'solidus_i18n' | ||
gem '$extension_name', path: '..' | ||
group :test, :development do | ||
platforms :mri do | ||
gem 'pry-byebug' | ||
end | ||
end | ||
RUBY | ||
|
||
unbundled bundle install --gemfile Gemfile | ||
|
||
unbundled bundle exec rake db:drop db:create | ||
|
||
unbundled bundle exec rails generate solidus:install \ | ||
--auto-accept \ | ||
--user_class=Spree::User \ | ||
--enforce_available_locales=true \ | ||
--with-authentication=true \ | ||
--payment-method=none \ | ||
--frontend=${SOLIDUS_FRONTEND} \ | ||
$@ | ||
|
||
unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations | ||
unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations | ||
|
||
echo | ||
echo "🚀 Sandbox app successfully created for $extension_name!" | ||
echo "🧪 This app is intended for test purposes." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ set -vx | |
|
||
gem install bundler --conservative | ||
bundle update | ||
bundle exec rake extension:test_app | ||
bin/rake clobber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'solidus_core' | ||
require 'solidus_support' | ||
|
||
require 'solidus_abandoned_carts/engine' | ||
require 'solidus_abandoned_carts/configuration' | ||
require 'solidus_abandoned_carts/version' |
Oops, something went wrong.