diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..5bbc07b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,71 @@ +version: 2.1 + +jobs: + test: + docker: + - image: cimg/ruby:2.7.4 + auth: + username: $DOCKERHUB_USERNAME + password: $DOCKERHUB_TOKEN + steps: + - checkout + - run: + name: Install Ruby gems + command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 + - run: + name: Set up test output directory + command: sudo install -o circleci -d ~/rspec + - run: + name: RSpec + command: | + bundle exec rspec \ + --color \ + --require spec_helper \ + --format documentation \ + --format RspecJunitFormatter \ + --out ~/rspec/rspec.xml + push_to_rubygems: + docker: + - image: circleci/ruby:2.7.4 + auth: + username: $DOCKERHUB_USERNAME + password: $DOCKERHUB_TOKEN + steps: + - checkout + - run: + name: Create .gem/credentials file + command: | + mkdir ~/.gem + echo "--- + :rubygems_api_key: $RUBYGEMS_API_KEY + " > ~/.gem/credentials + chmod 600 ~/.gem/credentials + - run: + name: Release + command: | + gem build http-exceptions + gem push http-exceptions*.gem + +workflows: + version: 2 + test_and_deploy: + jobs: + - test: + filters: + tags: + only: + - /^v.*/ + context: + - DockerHub + - push_to_rubygems: + requires: + - test + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v.*/ + context: + - DockerHub diff --git a/.ruby-gemset b/.ruby-gemset deleted file mode 100644 index a9baf89..0000000 --- a/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -http-exceptions diff --git a/.ruby-version b/.ruby-version index 76521af..30c5992 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.2.0 +ruby-2.7.4 diff --git a/.travis.yml b/.travis.yml index c81ee8d..68f29ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ rvm: - 2.1.8 - 2.2.4 - 2.3.0 + - 2.7.4 - ruby-head script: bundle exec rspec spec matrix: diff --git a/http-exceptions.gemspec b/http-exceptions.gemspec index 44f75d3..6edbdd9 100644 --- a/http-exceptions.gemspec +++ b/http-exceptions.gemspec @@ -18,6 +18,8 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "bundler", "~> 2.2" spec.add_development_dependency "rake" + spec.add_development_dependency "rspec" + spec.add_development_dependency 'rspec_junit_formatter' end