version: 2
jobs:
  build:
    machine: true
    steps:
      - checkout
      - run:
          name: Build and Install Deps
          command: |
            sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
            mv .circleci/circle_envs .env
            sudo docker-compose run web bundle install
            sudo docker-compose run web npm install
            sudo docker-compose run web bundle exec rails db:create
            sudo docker-compose run web bundle exec rails db:migrate
            sudo docker-compose run web rake keys:generate
      - run:
          name: Run Ruby Tests
          command: |
            sudo docker-compose run web rspec spec
      - run:
          name: Run JS Linters
          command: |
            sudo docker-compose run web npm run linters
      - run:
          name: Run JS Tests
          command: |
            sudo docker-compose run web npm run test-slow
            echo 'export COVERAGE_AVAILABLE=true' >> $BASH_ENV
            sudo docker-compose run -e CIRCLE_SHA1="$CIRCLE_SHA1" -e CIRCLE_BRANCH="$CIRCLE_BRANCH" web rake coverage:run
      - run:
          name: Report coverage to Coveralls
          command: |
            if [ "$COVERAGE_AVAILABLE" ]
            then
              sudo docker-compose run -e COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG web npm run coverage
            fi
          when: always # change to `on_success` for a stricter comparison

version: 2
jobs:
  build:
    machine: true
    steps:
      - checkout
      - run:
          name: Build and Install Deps
          command: |
            sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
            mv .circleci/circle_envs .env
            sudo docker-compose run web bundle install
            sudo docker-compose run web npm install
            sudo docker-compose run web bundle exec rails db:create
            sudo docker-compose run web bundle exec rails db:migrate
            sudo docker-compose run web rake keys:generate
      - run:
          name: Run Ruby Tests
          command: |
            sudo docker-compose run web rspec spec
      - run:
          name: Run JS Linters
          command: |
            sudo docker-compose run web npm run linters
      - run:
          name: Run JS Tests
          command: |
            sudo docker-compose --verbose run web npm run test-slow
            echo 'export COVERAGE_AVAILABLE=true' >> $BASH_ENV
            sudo docker-compose run -e CIRCLE_SHA1="$CIRCLE_SHA1" -e CIRCLE_BRANCH="$CIRCLE_BRANCH" web rake coverage:run
      - run:
          name: Report coverage to Coveralls
          command: |
            if [ "$COVERAGE_AVAILABLE" ]
            then
              sudo docker-compose run -e COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG web npm run coverage
            fi
          when: always # change to `on_success` for a stricter comparison

Add verbose flag to JS tests
Add verbose flag to JS tests
