version: 2 jobs: build: docker: - image: drivy/rails-ci:0.1.2 steps: - checkout - run: git fetch origin --depth=1000 # Install CodeClimate test reporter binary, rebuild without cache to update the binary - restore_cache: key: cc_test_reporter - run: name: Install Code Climate test reporter command: | [ -f bin/cc-test-reporter ] || curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./bin/cc-test-reporter chmod +x bin/cc-test-reporter - restore_cache: key: cc_test_reporter paths: - bin/cc-test-reporter - run: name: "Creating a Gemfile.lock without bundler's version" command: "head -n -3 Gemfile.lock > Gemfile.lock.no-version" # Bundle install with cache, Ignore bundler version - restore_cache: key: timed_deprecation-{{ checksum "Gemfile.lock.no-version"}} - run: name: Install Ruby dependencies command: bundle install --path vendor/bundle --jobs=`nproc` - save_cache: key: timed_deprecation-{{ checksum "Gemfile.lock.no-version"}} paths: - vendor/bundle - run: name: RSpec command: | ./bin/cc-test-reporter before-build bundle exec rspec --format documentation ./bin/cc-test-reporter after-build --exit-code $?