bukalapak/toggleable

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
  build:
    docker:
       - image: ruby:2.3.0
       - image: redis:3.2-alpine
    working_directory: ~/toggleable

    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "Gemfile.lock" }}
          - v1-dependencies-
      - run:
          name: Installing gems
          command: |
            gem install bundler -v 1.14.6
      - 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 rubocop
          command: |
            bundle exec rake lint
      - run:
          name: run tests
          command: |
            mkdir /tmp/test-results
            TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"

            bundle exec rspec --format progress \
                              --format RspecJunitFormatter \
                              --out /tmp/test-results/rspec.xml \
                              $TEST_FILES
      - store_test_results:
          path: /tmp/test-results
      - store_artifacts:
          path: /tmp/test-results
          destination: test-results