Skip to content

Commit

Permalink
Added Circle CI config, bumped Braintree
Browse files Browse the repository at this point in the history
  • Loading branch information
damianlegawiec committed Apr 30, 2024
1 parent 8948cea commit de8e6eb
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 55 deletions.
115 changes: 115 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
version: 2.1

defaults: &defaults
environment: &environment
CIRCLE_TEST_REPORTS: /tmp/test-results
CIRCLE_ARTIFACTS: /tmp/test-artifacts
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_PATH: ~/spree/vendor/bundle
working_directory: ~/spree
docker:
- image: &ruby_image cimg/ruby:3.3-browsers

run_tests: &run_tests
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- spree-bundle-{{ .Branch }}
- spree-bundle
- run:
name: Add keyserver
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
- run:
name: Install libvips
command: sudo apt-get update && sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
- run:
name: Ensure bundle Install
command: |
bundle check || bundle install
- run:
name: Create test app
command: |
bundle exec rake test_app
- run:
name: Run Rspec
command: |
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec --format documentation \
--format RspecJunitFormatter \
-o ~/rspec/rspec.xml \
-- ${TESTFILES}
- store_test_results:
path: ~/rspec
- store_artifacts:
path: tmp/capybara

jobs:
bundle:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- spree-bundle-{{ .Branch }}
- spree-bundle
- run:
name: Add keyserver
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
- run:
name: Install libvips
command: sudo apt-get update && sudo apt-get install libvips
- run:
name: Set bundle path
command: bundle config --local path vendor/bundle
- run:
name: Bundle Install
command: |
bundle check || bundle install
- save_cache:
paths:
- vendor/bundle
key: spree-bundle-{{ checksum "Gemfile.lock" }}

tests_postgres: &tests_postgres
<<: *run_tests
environment: &postgres_environment
<<: *environment
DB: postgres
DB_HOST: localhost
DB_USERNAME: postgres
docker:
- image: *ruby_image
- image: &postgres_image cimg/postgres:16.2
environment:
POSTGRES_USER: postgres

tests_mysql: &tests_mysql
<<: *run_tests
environment: &mysql_environment
<<: *environment
DB: mysql
DB_HOST: 127.0.0.1
DB_USERNAME: root
COVERAGE: true
COVERAGE_DIR: /tmp/workspace/simplecov
docker:
- image: *ruby_image
- image: &mysql_image cimg/mysql:8.0

workflows:
version: 2
main:
jobs:
- bundle
- tests_postgres:
requires:
- bundle
- tests_mysql:
requires:
- bundle
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

14 changes: 12 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
source 'https://rubygems.org'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
"https://github.com/#{repo_name}.git"
end

gem 'rails-controller-testing'
gem 'spree', github: 'spree/spree', branch: 'main'
gem 'spree_emails', github: 'spree/spree', branch: 'main'
gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
gem 'spree_frontend', github: 'spree/spree_rails_frontend', branch: 'main'

if ENV['DB'] == 'mysql'
gem 'mysql2'
elsif ENV['DB'] == 'postgres'
gem 'pg'
else
gem 'pg', '~> 1.1'
gem 'sqlite3', '~> 1.4'
end

gem 'webdrivers'

gemspec
9 changes: 0 additions & 9 deletions Guardfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Spree Commerce Inc. and other contributors.
Copyright (c) 2014-2024 Spree Commerce Inc., Spark Solutions Sp. z o.o. and other contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
2 changes: 1 addition & 1 deletion spec/models/gateway/braintree_gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

describe 'payment profile failure' do
before do
country = Spree::Country.default
country = Spree::Store.default.default_country
state = country.states.first
address = create(:address,
firstname: 'John',
Expand Down
6 changes: 3 additions & 3 deletions spree_gateway.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_gateway'
s.version = SpreeGateway.version
s.summary = 'Additional Payment Gateways for Spree Commerce'
s.summary = 'Collection of Payment Gateways for Spree Commerce such as Stripe, Braintree, etc.'
s.description = s.summary

s.author = 'Spree Commerce'
Expand All @@ -28,10 +28,10 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'spree_core', '>= 3.7.0'
s.add_dependency 'spree_core', '>= 3.7'
s.add_dependency 'spree_extension'

s.add_development_dependency 'braintree', '~> 3.0.0'
s.add_development_dependency 'braintree', '~> 4.20'
s.add_development_dependency 'rspec-activemodel-mocks'
s.add_development_dependency 'spree_dev_tools'
end

0 comments on commit de8e6eb

Please sign in to comment.