diff --git a/.circleci/config.yml b/.circleci/config.yml index d61f909..85d0d26 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,43 +1,61 @@ +--- version: 2.1 +tag-trigger: &tag-trigger + tags: + only: /^v.*/ + commands: + setup-bundler: + steps: + - run: + name: setup bundler + command: | + sudo gem update --system + sudo gem uninstall bundler + sudo rm /usr/local/bin/bundle || true + sudo rm /usr/local/bin/bundler || true + sudo gem install bundler --version 2.2.21 + bundle config set path 'vendor/bundle' + install_dependencies: steps: - restore_cache: keys: - - v1-dependencies-{{ checksum "Gemfile" }} + - v2-dependencies-{{ checksum "Gemfile" }} # fallback to using the latest cache if no exact match is found - - v1-dependencies + - v2-dependencies - run: name: Install dependencies command: | - bundle install --jobs=3 --retry=3 --path vendor/bundle + bundle install --jobs=3 --retry=3 - save_cache: - key: v1-dependencies-{{ checksum "Gemfile" }} + key: v2-dependencies-{{ checksum "Gemfile" }} paths: - ./vendor/bundle unittests: steps: + - setup-bundler - install_dependencies - run: name: Run unittests command: | bundle exec rake jobs: - ruby-255-unittest: + ruby-262-unittest: docker: - - image: circleci/ruby:2.5.5 + - image: circleci/ruby:2.6.2 working_directory: ~/repo steps: - checkout - unittests - ruby-262-unittest: + ruby-270-unittest: docker: - - image: circleci/ruby:2.6.2 + - image: circleci/ruby:2.7.0 working_directory: ~/repo steps: - checkout @@ -62,20 +80,22 @@ workflows: version: 2 tests: jobs: - - ruby-255-unittest: - context: autotestaccount - ruby-262-unittest: + filters: + <<: *tag-trigger + context: autotestaccount + - ruby-270-unittest: + filters: + <<: *tag-trigger context: autotestaccount - push-rubygems: requires: - - ruby-255-unittest - ruby-262-unittest + - ruby-270-unittest filters: - tags: - only: /^v.*/ + <<: *tag-trigger branches: ignore: /.*/ - nightly: triggers: - schedule: @@ -85,7 +105,7 @@ workflows: only: - main jobs: - - ruby-255-unittest: - context: autotestaccount - ruby-262-unittest: context: autotestaccount + - ruby-270-unittest: + context: autotestaccount diff --git a/3scale-api.gemspec b/3scale-api.gemspec index 81bc06c..b70103f 100644 --- a/3scale-api.gemspec +++ b/3scale-api.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |spec| spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 2.6' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake', '~> 13.0'