version: 2.1 update_bundler: &update_bundler run: name: update bundler command: gem update bundler bundle_install: &bundle_install run: name: bundle install command: bundle install --path vendor/bundle --jobs 4 git statusrestore_bundle_cache: &restore_bundle_cache restore_cache: key: cache-bundler-{{ checksum "Gemfile.lock" }} jobs: build: docker: - image: circleci/ruby:2.7.2 steps: - checkout - *restore_bundle_cache - *update_bundler - *bundle_install - save_cache: key: cache-bundler-{{ checksum "Gemfile.lock" }} paths: - vendor/bundle rubocop: docker: - image: circleci/ruby:2.7.2 steps: - checkout - *restore_bundle_cache - *update_bundler - *bundle_install - run: bundle exec rubocop rspec: docker: - image: circleci/ruby:2.7.2 steps: - checkout - *restore_bundle_cache - *update_bundler - *bundle_install - run: command: bundle exec rspec workflows: version: 2.1 rspec: jobs: - build - rubocop: requires: [build] - rspec: requires: [build]