version: 2 jobs: build: working_directory: ~/circleci-narou docker: - image: circleci/ruby:2.5 environment: BUNDLE_JOBS: 1 BUNDLE_RETRY: 3 BUNDLE_PATH: vendor/bundle steps: - checkout - run: name: Install bundler 2.1.4 command: gem install bundler:2.1.4 # Restore bundle cache - restore_cache: keys: - narou-bundle-{{ checksum "Gemfile.lock" }} - narou-bundle- - run: name: Bundle Install command: bundle check || bundle install # Store bundle cache - save_cache: key: narou-bundle-{{ checksum "Gemfile.lock" }} paths: - vendor/bundle - run: name: Run rspec command: | bundle exec rspec \ --format RspecJunitFormatter \ --out test_results/rspec/results.xml \ --format progress \ $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) # Save test results for timing analysis - store_test_results: path: test_results - store_artifacts: path: ./coverage destination: artifact-file