version: 2 jobs: build: docker: - image: circleci/ruby:2.3.3-node environment: RAILS_ENV: test steps: - checkout # Restore bundle cache - restore_cache: key: rails-{{ checksum "danger-wcc.gemspec" }} # Bundle install dependencies - run: bundle install --path /tmp/vendor/bundle # Store bundle cache - save_cache: key: rails-{{ checksum "danger-wcc.gemspec" }} paths: - /tmp/vendor/bundle # run Danger - type: shell command: | bundle exec danger # run rubocop - type: shell command: | bundle exec rubocop # Run rspec in parallel - type: shell command: | bundle exec rspec --profile 10 \ --format RspecJunitFormatter \ --out test_results/rspec.xml \ --format documentation \ --order rand \ $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) # Save test results for timing analysis - store_test_results: path: test_results