kirushik/critical_chain

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2.1

orbs:
  browser-tools: circleci/browser-tools@1.4.8

jobs:
  build:
    parallelism: 2
    docker:
      - image: cimg/ruby:3.3.0-browsers
        environment:
          BUNDLE_JOBS: 3
          BUNDLE_RETRY: 3
          BUNDLE_PATH: vendor/bundle
          RAILS_ENV: test
          CACHE_VERSION: 1
    steps:
      - checkout

      - browser-tools/install-chrome
      - browser-tools/install-chromedriver

      - restore_cache:
          keys:
            - criticalchain-bundle-{{ .Environment.CACHE_VERSION }}-{{ checksum "Gemfile.lock" }}
      - run:
          name: Bundle Install
          command: bundle check || bundle install
      - save_cache:
          key: criticalchain-bundle-{{ .Environment.CACHE_VERSION }}-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle

      - run:
          name: Database setup
          command: bundle exec rake db:schema:load --trace

      - run:
          name: Run rspec with JUnit formatter
          shell: /bin/bash
          command: |
            bundle exec rspec --profile 10 \
                              --format RspecJunitFormatter \
                              --out test_results/rspec.xml \
                              --format progress \
                              $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
      - store_test_results:
          path: test_results


workflows:
  version: 2
  build-and-deploy:
    jobs:
      - build