Skip to content

Commit

Permalink
Remove travis-ci dependency by moving completely to CircleCI
Browse files Browse the repository at this point in the history
The "wwtd" rubygem along with Travis CI configuration file basically run the suite test against different versions of Ruby and Rails.
This causes problems when the ruby/rails combination are ruby versions lower than 2.5 and the rails version is 6 since this version of rails only supports ruby version 2.5.0 or higher.
  • Loading branch information
klebervirgilio committed Dec 1, 2019
1 parent d5d8bbc commit 5261990
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 71 deletions.
154 changes: 116 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,106 @@ defaults: &defaults
RACK_ENV: test
VAULT_VERSION: 0.10.4

aliases:
environment: &environment
RACK_ENV: test
VAULT_VERSION: 0.10.4
command: &ruby-command |
bundle check --path=vendor/bundle || bundle install --binstubs --jobs 4 --path=vendor/bundle --retry 3
bundle exec rake app:db:create
bundle exec rake app:db:schema:load
bundle exec rake app:db:test:prepare
bundle exec rake
cache:
- restore_cache: &restore_cache
keys:
- vault-rails-{{checksum "fc-vault-rails.gemspec" }}-{{checksum "Appraisals" }}
- save_cache: &save_cache
key: vault-rails-{{checksum "fc-vault-rails.gemspec" }}-{{checksum "Appraisals" }}
paths:
- vendor/bundle
runs:
- run: &install-vault
name: Install Vault
command: |
wget -O vault.zip -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip
unzip vault.zip
sudo mv vault /usr/local/bin/
- run: &rails4
shell: /bin/bash -l
name: Rails 4.2
environment:
BUNDLE_GEMFILE: gemfiles/rails_4.2.gemfile
command: *ruby-command
- run: &rails5
shell: /bin/bash -l
name: Rails 5.0
environment:
BUNDLE_GEMFILE: gemfiles/rails_5.0.gemfile
command: *ruby-command
- run: &rails51
shell: /bin/bash -l
name: Rails 5.1
environment:
BUNDLE_GEMFILE: gemfiles/rails_5.1.gemfile
command: *ruby-command
- run: &rails52
shell: /bin/bash -l
name: Rails 5.2
environment:
BUNDLE_GEMFILE: gemfiles/rails_5.2.gemfile
command: *ruby-command
- run: &rails6
shell: /bin/bash -l
name: Rails 5.2
environment:
BUNDLE_GEMFILE: gemfiles/rails_6.gemfile
command: *ruby-command


jobs:
tests:
<<: *defaults

test_ruby_2_3:
docker:
- image: circleci/ruby:2.3
environment:
RACK_ENV: test
VAULT_VERSION: 0.10.4
steps:
- checkout
- run: yum -y install wget unzip sqlite
- run: yum clean all

- run:
name: Install Vault
command: |
wget -O vault.zip -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip
unzip vault.zip
mv vault /usr/local/bin/
- restore_cache:
keys:
- vault-rails-{{checksum "fc-vault-rails.gemspec" }}-{{checksum ".travis.yml" }}

- run:
shell: /bin/bash -l
command: |
rvm use --default 2.5.1
bundle check --path=/usr/local/rvm/gems || bundle install --path=/usr/local/rvm/gems
- run:
shell: /bin/bash -l
command: |
bundle exec rake app:db:create
bundle exec rake app:db:schema:load
bundle exec rake app:db:test:prepare
bundle exec wwtd
- save_cache:
key: vault-rails-{{checksum "fc-vault-rails.gemspec" }}-{{checksum ".travis.yml" }}
paths:
- /usr/local/rvm/gems
- run: *install-vault
- run: *rails4
- run: *rails5
- run: *rails51
- run: *rails52

test_ruby_2_4:
docker:
- image: circleci/ruby:2.4
environment:
RACK_ENV: test
VAULT_VERSION: 0.10.4
steps:
- checkout
- run: *install-vault
- run: *rails4
- run: *rails5
- run: *rails51
- run: *rails52

test_ruby_2_5:
docker:
- image: circleci/ruby:2.5
environment:
RACK_ENV: test
VAULT_VERSION: 0.10.4
steps:
- checkout
- run: *install-vault
- run: *rails4
- run: *rails5
- run: *rails51
- run: *rails52
- run: *rails6

publish-pre-release:
<<: *defaults
Expand Down Expand Up @@ -128,7 +190,19 @@ workflows:

test-and-release:
jobs:
- tests:
- test_ruby_2_3:
context: org-global
filters:
tags:
only: /.*/

- test_ruby_2_4:
context: org-global
filters:
tags:
only: /.*/

- test_ruby_2_5:
context: org-global
filters:
tags:
Expand All @@ -142,7 +216,9 @@ workflows:
tags:
ignore: /.*/
requires:
- tests
- test_ruby_2_3
- test_ruby_2_4
- test_ruby_2_5

- publish-release:
context: org-global
Expand All @@ -152,4 +228,6 @@ workflows:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
requires:
- tests
- test_ruby_2_3
- test_ruby_2_4
- test_ruby_2_5
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion fc-vault-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake", "~> 10.0"
s.add_development_dependency "rspec", "~> 3.2"
s.add_development_dependency "sqlite3", "~> 1.3.6"
s.add_development_dependency "wwtd"
end

0 comments on commit 5261990

Please sign in to comment.