marcqualie/cloudapp-export

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.6.6
    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "Gemfile.lock" }}

      - run:
          name: install dependencies
          command: |
            gem install bundler -v '2.1.4'
            bundle install --jobs=4 --retry=3 --path vendor/bundle

      - save_cache:
          paths:
            - ./vendor/bundle
          key: v1-dependencies-{{ checksum "Gemfile.lock" }}

      # Download + prepare CodeClimate for coverage
      - run:
          name: setup CodeClimate test-reporter
          command: |
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
            chmod +x ./cc-test-reporter

      - run:
          name: rspec
          command: |
            ./cc-test-reporter before-build
            bundle exec rake test
            ./cc-test-reporter after-build --prefix coverage --coverage-input-type lcov --exit-code $?

      - run:
          name: rubocop
          when: always
          command: |
            bundle exec rake rubocop