.circleci/config.yml in friendly_shipping-0.6.5 vs .circleci/config.yml in friendly_shipping-0.7.0

- old
+ new

@@ -1,15 +1,18 @@ # Ruby CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-ruby/ for more details # -version: 2 +version: 2.1 jobs: - build: + test: + parameters: + ruby-version: + type: string docker: # specify the version you desire here - - image: circleci/ruby:2.5 + - image: cimg/ruby:<< parameters.ruby-version >> # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ # - image: circleci/postgres:9.4 @@ -20,11 +23,11 @@ - checkout # Download and cache dependencies - restore_cache: keys: - - v1-dependencies-{{ checksum "friendly_shipping.gemspec" }} + - v1-dependencies-{{ checksum "friendly_shipping.gemspec" }}-<< parameters.ruby-version >> # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: install dependencies @@ -33,11 +36,11 @@ bundle install --jobs=4 --retry=3 --path vendor/bundle - save_cache: paths: - ./vendor/bundle - key: v1-dependencies-{{ checksum "Gemfile.lock" }} + key: v1-dependencies-{{ checksum "Gemfile.lock" }}-<< parameters.ruby-version >> - run: name: run Rubocop command: bundle exec rubocop @@ -58,5 +61,15 @@ - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results + +workflows: + build_and_test: + jobs: + - test: + matrix: + parameters: + # https://github.com/CircleCI-Public/cimg-ruby + # only supports the last three ruby versions + ruby-version: ["3.1", "3.0", "2.7"]