schneidmaster/debatevid.io

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
jobs:
  test:
    working_directory: ~/debatevid.io
    docker:
      - image: circleci/ruby:2.6-node
        environment:
          NODE_ENV: test
          RAILS_ENV: test
      - image: circleci/postgres:9.6
        environment:
          POSTGRES_USER: circleci
          POSTGRES_PASSWORD: circleci

    steps:
      - checkout
      - restore_cache:
          key: bundler-cache-{{ arch }}-{{ checksum "Gemfile.lock" }}
      - run:
          name: Install bundle dependencies
          command: bundle check --path=vendor/bundle || bundle install --jobs=4 --retry=3 --path=vendor/bundle
      - save_cache:
          key: bundler-cache-{{ arch }}-{{ checksum "Gemfile.lock" }}
          paths:
            - ./vendor/bundle
      - restore_cache:
          key: yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
      - run:
          name: Install yarn dependencies
          command: yarn install
      - save_cache:
          key: yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
      - run:
          name: Build yarn
          command: yarn build
      - run:
          name: Setup database
          command: bundle exec rake db:create db:schema:load
      - run:
          name: Rspec
          command: bundle exec rspec
      - run:
          name: Rubocop
          command: bundle exec rubocop
      - run:
          name: ESLint
          command: yarn lint
      - run:
          name: Report to CodeClimate
          command: bundle exec codeclimate-test-reporter
      - store_artifacts:
          path: ./coverage
      
workflows:
  version: 2
  test:
    jobs:
      - test