Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1x ci #1015

Closed
wants to merge 6 commits into from
Closed

0.1x ci #1015

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
118 changes: 118 additions & 0 deletions .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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- image: circleci/ruby:2.6
- image: circleci/ruby:2.6-stretch

<<: *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: /.*/
15 changes: 15 additions & 0 deletions .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
4 changes: 4 additions & 0 deletions .codeclimate.yml
@@ -0,0 +1,4 @@
version: "2"
plugins:
rubocop:
enabled: false
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.