-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed Spree 4 compatibility * fixes * Update usa_address_factory.rb * fixes * fixes * Fixed #178 * Update vcr.rb * require spree 4.3+
- Loading branch information
1 parent
b579675
commit 202c7c8
Showing
21 changed files
with
237 additions
and
222 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,84 +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: | ||
rspec: | ||
parameters: | ||
ruby-version: | ||
type: string | ||
gemfile: | ||
type: string | ||
database: | ||
type: string | ||
docker: | ||
- image: circleci/ruby:<< parameters.ruby-version >>-node-browsers | ||
environment: | ||
DB: << parameters.database >> | ||
- image: circleci/mysql:5.7-ram | ||
environment: | ||
MYSQL_DATABASE: avatax | ||
MYSQL_USER: avatax | ||
MYSQL_PASSWORD: password | ||
- image: circleci/postgres:9.6-alpine | ||
environment: | ||
POSTGRES_USER: 'avatax' | ||
POSTGRES_PASSWORD: 'password' | ||
POSTGRES_DB: 'avatax' | ||
bundle: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- when: | ||
condition: | ||
equal: ["mysql", << parameters.database >>] | ||
steps: | ||
- run: | ||
name: Configure MySQL2 | ||
# Hack to set environment variable for later steps https://circleci.com/docs/2.0/env-vars/#example-configuration-of-environment-variables | ||
command: echo 'export DATABASE_URL="mysql2://avatax:[email protected]/avatax"' >> $BASH_ENV | ||
- when: | ||
condition: | ||
equal: ["postgres", << parameters.database >>] | ||
steps: | ||
- run: | ||
name: Configure Postgres | ||
command: echo 'export DATABASE_URL="postgresql://avatax:[email protected]/avatax"' >> $BASH_ENV | ||
- run: | ||
name: Configure bundler | ||
command: bundle config --local path '~/.bundle' | ||
- run: | ||
name: Select Gemfile | ||
command: cp gemfiles/<< parameters.gemfile >>.gemfile gemfiles/ci.gemfile | ||
- restore_cache: | ||
keys: | ||
- bundler-v10-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "gemfiles/ci.gemfile" }} | ||
- bundler-v10-<< parameters.ruby-version >>-<< parameters.gemfile >> | ||
- spree-bundle-{{ .Branch }} | ||
- spree-bundle | ||
- run: | ||
name: Install dependencies | ||
command: bundle install --gemfile=gemfiles/ci.gemfile | ||
- save_cache: | ||
key: bundler-v10-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "gemfiles/ci.gemfile" }} | ||
paths: | ||
- "~/.bundle" | ||
name: Add keyserver | ||
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B | ||
- run: | ||
name: Setup test app | ||
command: bundle exec --gemfile=gemfiles/ci.gemfile rake test_app | ||
name: Install libvips | ||
command: sudo apt-get update && sudo apt-get install libvips | ||
- run: | ||
name: Run RSpec | ||
command: bundle exec --gemfile=gemfiles/ci.gemfile rake spec | ||
workflows: | ||
all-specs: | ||
jobs: | ||
- rspec: | ||
matrix: | ||
parameters: | ||
database: | ||
- mysql | ||
- postgres | ||
gemfile: | ||
- spree_4_2 | ||
- spree_4_3 | ||
ruby-version: | ||
- "3.0" | ||
- "2.7" | ||
|
||
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.