From de43cc0c5b6201028f51d26e76f0bf999bb06ace Mon Sep 17 00:00:00 2001 From: tknzk Date: Tue, 7 Jan 2020 12:41:38 +0900 Subject: [PATCH 1/3] test on ruby 2.4, 2.6, 2.7 --- .circleci/config.yml | 85 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 373146b..526cc9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,86 @@ -version: 2 +version: 2.1 -jobs: - ruby-2.5: +executors: + working_directory: /root/jpostcode-rb + ruby_2_7: + docker: + - image: rubylang/ruby:2.7.0-bionic + ruby_2_6: + docker: + - image: rubylang/ruby:2.6.5-bionic + ruby_2_5: docker: - - image: ruby:2.5.7 + - image: rubylang/ruby:2.5.7-bionic + ruby_2_4: + docker: + - image: rubylang/ruby:2.4.9-bionic + +commands: + install_system_dependencies: + description: "Install system dependencies" + steps: + - run: + name: Install System Dependencies + # https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers + command: apt-get update -y && apt-get install -y ssh + + bundle_gems: + description: "Bundle gems" + steps: + - run: + name: Bundle gems + command: | + gem install bundler -v 1.17.3 --no-document --force + bundle install + + run_tests: + description: "Run tests" + steps: + - run: + name: Run tests + command: | + bundle exec rake + bundle exec rubocop + +jobs: + run_tests_on_ruby_2_7: + executor: ruby_2_7 + steps: + - install_system_dependencies + - checkout + - submodule_sync + - bundle_gems + - run_tests + run_tests_on_ruby_2_6: + executor: ruby_2_6 + steps: + - install_system_dependencies + - checkout + - submodule_sync + - bundle_gems + - run_tests + run_tests_on_ruby_2_5: + executor: ruby_2_5 + steps: + - install_system_dependencies + - checkout + - submodule_sync + - bundle_gems + - run_tests + run_tests_on_ruby_2_4: + executor: ruby_2_4 steps: + - install_system_dependencies - checkout - - run: bundle install - - run: bundle exec rake - - run: bundle exec rubocop + - submodule_sync + - bundle_gems + - run_tests workflows: version: 2 test: jobs: - - ruby-2.5 + - run_tests_on_ruby_2_7 + - run_tests_on_ruby_2_6 + - run_tests_on_ruby_2_5 + - run_tests_on_ruby_2_4 From 8b0ddfa13b7e4c30a44e6a4e12c4098168ec1b61 Mon Sep 17 00:00:00 2001 From: tknzk Date: Tue, 7 Jan 2020 12:43:22 +0900 Subject: [PATCH 2/3] not use submodule_sync --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 526cc9a..c5e109d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,6 @@ jobs: steps: - install_system_dependencies - checkout - - submodule_sync - bundle_gems - run_tests run_tests_on_ruby_2_6: @@ -56,7 +55,6 @@ jobs: steps: - install_system_dependencies - checkout - - submodule_sync - bundle_gems - run_tests run_tests_on_ruby_2_5: @@ -64,7 +62,6 @@ jobs: steps: - install_system_dependencies - checkout - - submodule_sync - bundle_gems - run_tests run_tests_on_ruby_2_4: @@ -72,7 +69,6 @@ jobs: steps: - install_system_dependencies - checkout - - submodule_sync - bundle_gems - run_tests From 0b7a43d66053c60ecc522542e0e696a78fb2ddc9 Mon Sep 17 00:00:00 2001 From: tknzk Date: Tue, 7 Jan 2020 12:47:18 +0900 Subject: [PATCH 3/3] remove 2.4 --- .circleci/config.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9551627..43affed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,6 @@ executors: ruby_2_5: docker: - image: rubylang/ruby:2.5.7-bionic - ruby_2_4: - docker: - - image: rubylang/ruby:2.4.9-bionic commands: install_system_dependencies: @@ -63,13 +60,6 @@ jobs: - checkout - bundle_gems - run_tests - run_tests_on_ruby_2_4: - executor: ruby_2_4 - steps: - - install_system_dependencies - - checkout - - bundle_gems - - run_tests workflows: version: 2 @@ -78,4 +68,3 @@ workflows: - run_tests_on_ruby_2_7 - run_tests_on_ruby_2_6 - run_tests_on_ruby_2_5 - - run_tests_on_ruby_2_4