diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..79b2a6214 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,118 @@ +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 + - run: mkdir -p ~/test-results/rspec + - run: + name: Run tests + command: bundle exec rake test + - 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: + - . + + 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 + - ruby26: + requires: + - checkout_code + run-cc-reporter: true + - ruby25: + requires: + - checkout_code + - ruby24: + requires: + - checkout_code + - ruby23: + requires: + - checkout_code + - 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 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"' -