diff --git a/.circleci/config.yml b/.circleci/config.yml index 51f39e38..a85474d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c5d3399..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: ruby -cache: bundler -dist: trusty -sudo: false - -gemfile: - - Gemfile - - gemfiles/rails_4.2.gemfile - - gemfiles/rails_5.0.gemfile - - gemfiles/rails_5.1.gemfile - - gemfiles/rails_5.2.gemfile - -before_install: - - wget -O vault.zip -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip - - unzip vault.zip - - mkdir -p ~/bin - - mv vault ~/bin - - export PATH="~/bin:$PATH" - -branches: - only: - - master - -rvm: - - 2.3.7 - - 2.4.4 - - 2.5.1 - -before_script: - - bundle exec rake app:db:create - - bundle exec rake app:db:schema:load - - bundle exec rake app:db:test:prepare diff --git a/fc-vault-rails.gemspec b/fc-vault-rails.gemspec index 9659e139..04aa31e7 100644 --- a/fc-vault-rails.gemspec +++ b/fc-vault-rails.gemspec @@ -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