Sha256: 581c9eb5fbfee52dbbc331ef9ff77c4a50aad098ee1833a6abe696c5641dedfc

Contents?: true

Size: 1.96 KB

Versions: 1

Compression:

Stored size: 1.96 KB

Contents

# Ruby CircleCI 2.1 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2.1

workflows:
  version: 2

  commit:
     jobs:
       - build
       - tests:
           requires:
             - build
       - upload-coverage:
          requires:
             - tests

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: circleci/ruby:2.5.1

jobs:
  build:
    <<: *defaults
    steps:
      - run:
          name: Download cc-test-reporter
          command: |
            mkdir -p tmp/
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
            chmod +x ./tmp/cc-test-reporter
      - persist_to_workspace:
          root: tmp
          paths:
            - cc-test-reporter

  tests:
    <<: *defaults
    steps:
      - checkout
      - attach_workspace:
          at: ~/repo/tmp
      # Download and cache dependencies
      - restore_cache:
          keys:
            - v1-dependencies-{{ checksum "Gemfile.lock" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-
      - run:
          name: Install dependencies
          command: |
            bundle install --jobs=4 --retry=3 --path vendor/bundle
      - save_cache:
          paths:
            - ./vendor/bundle
          key: v1-dependencies-{{ checksum "Gemfile.lock" }}
      - run:
          name: Run tests
          command: |
            bundle exec rspec
            ./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.json coverage/.resultset.json
      - persist_to_workspace:
          root: tmp
          paths:
            - codeclimate.json
  upload-coverage:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo/tmp
      - run:
          name: Upload coverage results to Code Climate
          command: |
            ./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.json

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dru-1.0.0 .circleci/config.yml