From b115be99c0e596a2e7329b48548da8e970021ed8 Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:25:45 -0600 Subject: [PATCH 1/6] remove travis ci config --- .travis.yml | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d6535f56..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: ruby -script: bundle exec script/test - -rvm: - - 1.9.3 - - 2.0.0 - - 2.1.10 - - 2.2.10 - - 2.3.8 - - 2.4.5 - - 2.5.3 - - 2.6.0 - - ruby-head - - jruby-19mode - - jruby-20mode - - jruby-21mode - - jruby-head - -before_install: - - | - export RVM_CURRENT=`rvm current|cut -c6-8` - if [ "${RVM_CURRENT}" == "2.2" ]; then - gem install bundler -v '< 2' - fi - -matrix: - allow_failures: - # "A fatal error has been detected by the Java Runtime Environment: - # Internal Error (sharedRuntime.cpp:843)" - - rvm: jruby-19mode - - rvm: jruby-20mode - - rvm: jruby-21mode - - rvm: jruby-head - - rvm: ruby-head - fast_finish: true - -env: - matrix: - - SSL=no - - SSL=yes - global: - - JRUBY_OPTS="$JRUBY_OPTS --debug" -deploy: - provider: rubygems - api_key: - secure: EqbOu9BQp5jkivJ8qvTo89f3J49KOByBueU3XulrJ2Kqm/ov4RDFsmp9/uHAnSLdmKSkzZaeq79t1AUNfKGX1ZqkKgq/Nw2BKGFnh5ZOjrkrRZR1Vm09OHxqiViEbtg+jZ8VOLY/iDFEkNIzuj9/H3iHGXC0XiKH2LTHOFH63Bs= - gem: faraday - on: - tags: true - repo: lostisland/faraday - rvm: 2.4.5 - condition: '"$SSL" = "yes"' - From 7e5676d3b1319e4abe8147cd87234e6624b14497 Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:26:24 -0600 Subject: [PATCH 2/6] add CircleCI config --- .circleci/config.yml | 164 ++++++++++++++++++++++++++++++++++++ .circleci/setup-rubygems.sh | 15 ++++ .codeclimate.yml | 4 + 3 files changed, 183 insertions(+) create mode 100644 .circleci/config.yml create mode 100755 .circleci/setup-rubygems.sh create mode 100644 .codeclimate.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..8aaea06f3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,164 @@ +version: 2.1 + +# Share Steps: glued in using the YAML alias +# See https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/ +shared_ruby_steps: &shared_ruby_steps + parameters: + run-cc-reporter: + type: boolean + default: false + steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - "{{ .Environment.CACHE_KEY_PREFIX }}-v1-bundler-deps-{{ .Branch }}" + - run: + name: Bundle Install + command: bundle install --path vendor/bundle --jobs 7 --retry 15 + - when: + condition: << parameters.run-cc-reporter >> + steps: + - run: + name: Setup Code Climate test-reporter + command: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + ./cc-test-reporter before-build + - run: mkdir -p ~/test-results/rspec + - run: + name: Run tests + command: bundle exec rspec --require rspec_junit_formatter --format progress --format RspecJunitFormatter --out ~/test-results/rspec/results.xml + - when: + condition: << parameters.run-cc-reporter >> + steps: + - run: + name: Run Code Climate test-reporter + command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $? + - save_cache: + key: "{{ .Environment.CACHE_KEY_PREFIX }}-v1-bundler-deps-{{ .Branch }}" + paths: + - ./vendor/bundle + - store_test_results: + path: ~/test-results/rspec + - store_artifacts: + path: ./Gemfile.lock + - persist_to_workspace: + root: . + paths: + - ./vendor/bundle + +jobs: + checkout_code: + docker: + - image: circleci/ruby:2.6 + steps: + - checkout + - persist_to_workspace: + root: . + paths: + - . + + linting: + docker: + - image: circleci/ruby:2.6 + steps: + - attach_workspace: + at: . + - run: mkdir -p ~/test-results/linting + - run: + name: RuboCop + command: | + gem install rubocop rubocop-junit_formatter rubocop-performance --no-document + rubocop --require rubocop/formatter/junit_formatter \ + --require rubocop-performance \ + --format progress \ + --format RuboCop::Formatter::JUnitFormatter \ + --out ~/test-results/linting/rubocop.xml + when: always + - run: + name: Yard-Junk + command: | + gem install yard-junk --no-document + yard-junk --path lib + when: always + - store_test_results: + path: ~/test-results/linting + - store_artifacts: + path: ~/test-results/linting + + ruby26: + docker: + - image: circleci/ruby:2.6 + <<: *shared_ruby_steps + + ruby25: + docker: + - image: circleci/ruby:2.5 + <<: *shared_ruby_steps + + ruby24: + docker: + - image: circleci/ruby:2.4 + <<: *shared_ruby_steps + + ruby23: + docker: + - image: circleci/ruby:2.3 + <<: *shared_ruby_steps + + # Currently not in use + jruby92: + docker: + - image: circleci/jruby:9.2 + environment: + JRUBY_OPTS: "--debug" + <<: *shared_ruby_steps + + deploy: + docker: + - image: circleci/ruby:2.6 + steps: + - checkout + - run: + name: Setup Rubygems + command: bash .circleci/setup-rubygems.sh + + - run: + name: Publish to Rubygems + command: | + gem build faraday.gemspec + gem push "faraday-$(git describe --tags).gem" + +workflows: + version: 2 + test: + jobs: + - checkout_code + - linting: + requires: + - checkout_code + - ruby26: + requires: + - linting + run-cc-reporter: true + - ruby25: + requires: + - linting + - ruby24: + requires: + - linting + - ruby23: + requires: + - linting + - deploy: + requires: + - ruby23 + - ruby24 + - ruby25 + - ruby26 + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ diff --git a/.circleci/setup-rubygems.sh b/.circleci/setup-rubygems.sh new file mode 100755 index 000000000..257ff0cbd --- /dev/null +++ b/.circleci/setup-rubygems.sh @@ -0,0 +1,15 @@ + +# +# "Publishing RubyGems using Circle CI 2.0" explains how this works: +# +# https://medium.com/@pezholio/publishing-rubygems-using-circle-ci-2-0-1dbf06ae9942 +# +# - Get an API key from your profile page at RubyGems.org +# - Add the API key as an Environment variable in your repo’s CircleCI +# Project Settings/Build Settings/Environment Variables +# - Have this script execute in the deploy stage of the CI build +# - Now you can "gem push" + +mkdir ~/.gem +echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials +chmod 0600 /home/circleci/.gem/credentials diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 000000000..4686e5bc7 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,4 @@ +version: "2" +plugins: + rubocop: + enabled: false From 7b3caa1418b59005778f2e6c8960507420d1266f Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:28:58 -0600 Subject: [PATCH 3/6] add rubocop config --- .rubocop.yml | 27 +++++++++++++++++++++++++++ .rubocop_todo.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000..2d6080e79 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,27 @@ +inherit_from: .rubocop_todo.yml + +require: + - rubocop-performance + +AllCops: + DisplayCopNames: true + DisplayStyleGuide: true + TargetRubyVersion: 2.3 + +Metrics/BlockLength: + Exclude: + - spec/**/*.rb + - examples/**/*.rb + +Metrics/LineLength: + Exclude: + - spec/**/*.rb + - examples/**/*.rb + +Style/DoubleNegation: + Enabled: false + +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'examples/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 000000000..e9fbfc91b --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,29 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2019-04-08 21:22:38 +0200 using RuboCop version 0.67.2. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 37 +Metrics/AbcSize: + Max: 67 + +# Offense count: 4 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 233 + +# Offense count: 17 +Metrics/CyclomaticComplexity: + Max: 16 + +# Offense count: 48 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/MethodLength: + Max: 48 + +# Offense count: 13 +Metrics/PerceivedComplexity: + Max: 16 From 0396e358089c031c30ad3131b14bd8eb8c678513 Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:35:39 -0600 Subject: [PATCH 4/6] remove lint checks --- .circleci/config.yml | 39 ++++----------------------------------- .rubocop.yml | 27 --------------------------- .rubocop_todo.yml | 29 ----------------------------- 3 files changed, 4 insertions(+), 91 deletions(-) delete mode 100644 .rubocop.yml delete mode 100644 .rubocop_todo.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 8aaea06f3..788884385 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,34 +59,6 @@ jobs: paths: - . - linting: - docker: - - image: circleci/ruby:2.6 - steps: - - attach_workspace: - at: . - - run: mkdir -p ~/test-results/linting - - run: - name: RuboCop - command: | - gem install rubocop rubocop-junit_formatter rubocop-performance --no-document - rubocop --require rubocop/formatter/junit_formatter \ - --require rubocop-performance \ - --format progress \ - --format RuboCop::Formatter::JUnitFormatter \ - --out ~/test-results/linting/rubocop.xml - when: always - - run: - name: Yard-Junk - command: | - gem install yard-junk --no-document - yard-junk --path lib - when: always - - store_test_results: - path: ~/test-results/linting - - store_artifacts: - path: ~/test-results/linting - ruby26: docker: - image: circleci/ruby:2.6 @@ -135,22 +107,19 @@ workflows: test: jobs: - checkout_code - - linting: - requires: - - checkout_code - ruby26: requires: - - linting + - checkout_code run-cc-reporter: true - ruby25: requires: - - linting + - checkout_code - ruby24: requires: - - linting + - checkout_code - ruby23: requires: - - linting + - checkout_code - deploy: requires: - ruby23 diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 2d6080e79..000000000 --- a/.rubocop.yml +++ /dev/null @@ -1,27 +0,0 @@ -inherit_from: .rubocop_todo.yml - -require: - - rubocop-performance - -AllCops: - DisplayCopNames: true - DisplayStyleGuide: true - TargetRubyVersion: 2.3 - -Metrics/BlockLength: - Exclude: - - spec/**/*.rb - - examples/**/*.rb - -Metrics/LineLength: - Exclude: - - spec/**/*.rb - - examples/**/*.rb - -Style/DoubleNegation: - Enabled: false - -Style/Documentation: - Exclude: - - 'spec/**/*' - - 'examples/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index e9fbfc91b..000000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2019-04-08 21:22:38 +0200 using RuboCop version 0.67.2. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 37 -Metrics/AbcSize: - Max: 67 - -# Offense count: 4 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 233 - -# Offense count: 17 -Metrics/CyclomaticComplexity: - Max: 16 - -# Offense count: 48 -# Configuration parameters: CountComments, ExcludedMethods. -Metrics/MethodLength: - Max: 48 - -# Offense count: 13 -Metrics/PerceivedComplexity: - Max: 16 From 3c6bf7a8fa660006585c1c7d9ef852bfd7f5a5e5 Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:46:11 -0600 Subject: [PATCH 5/6] run test/unit, remove Code Climate test coverage reporter --- .circleci/config.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 788884385..7e294b530 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,25 +16,10 @@ shared_ruby_steps: &shared_ruby_steps - run: name: Bundle Install command: bundle install --path vendor/bundle --jobs 7 --retry 15 - - when: - condition: << parameters.run-cc-reporter >> - steps: - - run: - name: Setup Code Climate test-reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - run: mkdir -p ~/test-results/rspec - run: name: Run tests - command: bundle exec rspec --require rspec_junit_formatter --format progress --format RspecJunitFormatter --out ~/test-results/rspec/results.xml - - when: - condition: << parameters.run-cc-reporter >> - steps: - - run: - name: Run Code Climate test-reporter - command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $? + command: bundle rake test - save_cache: key: "{{ .Environment.CACHE_KEY_PREFIX }}-v1-bundler-deps-{{ .Branch }}" paths: From ead2288681d33f2fcc2fc8d27e147cfe0db9c297 Mon Sep 17 00:00:00 2001 From: rick olson Date: Tue, 3 Sep 2019 10:48:03 -0600 Subject: [PATCH 6/6] exec func disorder --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e294b530..79b2a6214 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ shared_ruby_steps: &shared_ruby_steps - run: mkdir -p ~/test-results/rspec - run: name: Run tests - command: bundle rake test + command: bundle exec rake test - save_cache: key: "{{ .Environment.CACHE_KEY_PREFIX }}-v1-bundler-deps-{{ .Branch }}" paths: