Skip to content

Commit

Permalink
Required ruby version is set to 2.7 + Ruby3.0 CI job (#30)
Browse files Browse the repository at this point in the history
* Required ruby version is set to 2.7 + Ruby3.0 CI job

* DNB-2917: circlci update
  • Loading branch information
dobrodushny authored Sep 12, 2023
1 parent 176eb31 commit 230b7ea
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 79 deletions.
108 changes: 33 additions & 75 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,38 @@
version: 2.0
version: 2.1

jobs:
ruby2.2:
docker:
- image: circleci/ruby:2.2
steps:
- checkout
- restore_cache:
key: gemfile-2-2-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
- run: bundle install -j3 --path vendor/bundle
- save_cache:
key: gemfile-2-2-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
paths:
- vendor/bundle
- run: bundle check --path vendor/bundle
- run: bundle exec rubocop
- run: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out tmp/results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- store_test_results:
path: tmp/results
docker-auth: &docker-auth
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_ACCESS_TOKEN

ruby2.3:
docker:
- image: circleci/ruby:2.3
steps:
- checkout
- restore_cache:
key: gemfile-2-3-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
- run: bundle install -j3 --path vendor/bundle
- save_cache:
key: gemfile-2-3-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
paths:
- vendor/bundle
- run: bundle check --path vendor/bundle
- run: bundle exec rubocop
- run: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out tmp/results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- store_test_results:
path: tmp/results

ruby2.4:
jobs:
bundle:
parameters:
ruby_version: { type: string }
docker:
- image: circleci/ruby:2.4
- image: cimg/ruby:<< parameters.ruby_version >>
<<: *docker-auth
steps:
- checkout
- restore_cache:
key: gemfile-2-4-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
- run: bundle install -j3 --path vendor/bundle
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
- run: bundle install -j3
- save_cache:
key: gemfile-2-4-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
paths:
- vendor/bundle
- run: bundle check --path vendor/bundle
- run: bundle exec rubocop
- run: |
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out tmp/results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
- store_test_results:
path: tmp/results

ruby2.5:
ruby:
parameters:
ruby_version: { type: string }
docker:
- image: circleci/ruby:2.5
- image: cimg/ruby:<< parameters.ruby_version >>
<<: *docker-auth
steps:
- checkout
- restore_cache:
key: gemfile-2-5-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
- run: bundle install -j3 --path vendor/bundle
- save_cache:
key: gemfile-2-5-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
paths:
- vendor/bundle
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
- run: gem install bundler:2.3.26
- run: bundle check --path vendor/bundle
- run: bundle exec rubocop
- run: |
Expand All @@ -93,12 +44,19 @@ jobs:
- store_test_results:
path: tmp/results


workflows:
version: 2
build:
jobs:
- ruby2.2
- ruby2.3
- ruby2.4
- ruby2.5
- bundle:
context: org-global
matrix:
parameters:
ruby_version: ['2.7', '3.0']
- ruby:
context: org-global
matrix:
parameters:
ruby_version: ['2.7', '3.0']
requires:
- bundle
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
AllCops:
TargetRubyVersion: 2.7

Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

group :development do
Expand Down
2 changes: 1 addition & 1 deletion lib/selligent/middlewares/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Selligent
module Middlewares
# Auth is a Faraday middleware
class Authorization < ::Faraday::Middleware
AUTH_HEADER = 'X-ApiKey'.freeze
AUTH_HEADER = 'X-ApiKey'

def call(env)
env[:request_headers][AUTH_HEADER] = auth_header
Expand Down
2 changes: 1 addition & 1 deletion lib/selligent/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Selligent
VERSION = '0.1.3'.freeze
VERSION = '0.1.3'
end
7 changes: 5 additions & 2 deletions selligent.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'selligent/version'
Expand All @@ -12,14 +14,15 @@ Gem::Specification.new do |s|
s.summary = 'Selligent Ruby API client'
s.description = 'Provides access to the Selligent REST API'
s.license = 'MIT'
s.required_ruby_version = '>= 2.7'

s.files = `git ls-files -z`.split("\x0").reject do |f|
s.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end

s.require_paths = ['lib']

s.add_development_dependency 'bundler', '~> 1.16'
s.add_development_dependency 'bundler', '~> 2.3'
s.add_dependency 'faraday'
s.add_dependency 'faraday_middleware'
end
2 changes: 2 additions & 0 deletions spec/selligent/client/content_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Content do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/cumulio_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Cumulio do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/data_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Data do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/journeys_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Status do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/lists_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Lists do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/organizations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Organizations do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/single_batch_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::SingleBatch do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/status_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Journeys do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/stored_procedures_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::StoredProcedures do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/tasks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Tasks do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/transactional_bulk_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::TransactionalBulk do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client/transactionals_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client::Transactionals do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Client do
Expand Down
2 changes: 2 additions & 0 deletions spec/selligent/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Selligent::Configuration do
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'selligent'
require 'timecop'
require 'webmock/rspec'
Expand Down

0 comments on commit 230b7ea

Please sign in to comment.