version: 2
jobs:
  build:
    working_directory: ~/hash_attribute_assignment
    parallelism: 2
    docker:
      - image: circleci/ruby:2.3.4

    steps:
      - checkout

      ## Bundler
      # Restore Cache
      - restore_cache:
          keys:
            - gem-cache-{{ checksum "hash_attribute_assignment.gemspec" }}
      # Install
      - run: bundle check || bundle install --path vendor/bundle
      # Store Cache
      - save_cache:
          key: gem-cache-{{ checksum "hash_attribute_assignment.gemspec" }}
          paths:
            - vendor/bundle

      - type: shell
        command: |
          bundle exec rubocop \
            --config .rubocop.yml \
            --format RuboCop::Formatter::JUnitFormatter \
            --out /tmp/test-results/rubocop.xml \
            --format progress \
            --force-exclusion \
            $(bundle exec rubocop --list-target-files | circleci tests split --split-by=filesize --show-counts)

      # Run rspec in parallel
      - type: shell
        command: |
          bundle exec rspec --profile 10 \
                            --format RspecJunitFormatter \
                            --out /tmp/test-results/rspec.xml \
                            --format progress \
                            $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings --show-counts)

      # Save artifacts
      - type: store_test_results
        path: /tmp/test-results

      - store_artifacts:
          path: ~/hash_attribute_assignment/.rspec_failed_examples


version: 2
jobs:
  build:
    working_directory: ~/hash_attribute_assignment
    parallelism: 2
    docker:
      - image: circleci/ruby:2.3.4

    steps:
      - checkout

      ## Bundler
      # Restore Cache
      - restore_cache:
          keys:
            - gem-cache-{{ checksum "hash_attribute_assignment.gemspec" }}
      # Install
      - run: bundle check || bundle install --path vendor/bundle
      # Store Cache
      - save_cache:
          key: gem-cache-{{ checksum "hash_attribute_assignment.gemspec" }}
          paths:
            - vendor/bundle

      - type: shell
        command: |
          bundle exec rubocop \
            --config .rubocop.yml \
            -r $(bundle show rubocop-junit-formatter)/lib/rubocop/formatter/junit_formatter.rb \
            --format RuboCop::Formatter::JUnitFormatter \
            --out /tmp/test-results/rubocop.xml \
            --format progress \
            --force-exclusion \
            $(bundle exec rubocop --list-target-files | circleci tests split --split-by=filesize --show-counts)

      # Run rspec in parallel
      - type: shell
        command: |
          bundle exec rspec --profile 10 \
                            --format RspecJunitFormatter \
                            --out /tmp/test-results/rspec.xml \
                            --format progress \
                            $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings --show-counts)

      # Save artifacts
      - type: store_test_results
        path: /tmp/test-results

      - store_artifacts:
          path: ~/hash_attribute_assignment/.rspec_failed_examples


Revert "Lets try not manually requiring this file"
Revert "Lets try not manually requiring this file"

This reverts commit d6f696e13fd7679fb84ed043d7608da8efd66707.
