version: 2

jobs:
  build:
    environment:
      CC_TEST_REPORTER_ID: e3d75ff107da64b21112668c156648bb46095c70ea6660964a402c766c92225c
    docker:
      - image: notnoopci/php:7.1.5-browsers
    working_directory: ~/repo
    steps:
      - checkout
      - run: sudo pecl install xdebug && sudo docker-php-ext-enable xdebug
      - run: composer self-update
      - restore_cache:
          keys:
            - composer-v1-{{ checksum "composer.json" }}
            - composer-v1-
      - run: composer install -n --prefer-dist
      - save_cache:
          key: composer-v1-{{ checksum "composer.json" }}
          paths:
            - vendor
      - run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
      - run: chmod +x ./cc-test-reporter
      - run: sudo mkdir -p $CIRCLE_TEST_REPORTS/phpunit
      - run: ./cc-test-reporter before-build
      - run: sudo vendor/bin/phpunit --coverage-clover $CIRCLE_TEST_REPORTS/phpunit/clover.xml
      - run: ./cc-test-reporter after-build -t clover --exit-code $?

version: 2

jobs:
  build:
    environment:
      CC_TEST_REPORTER_ID: e3d75ff107da64b21112668c156648bb46095c70ea6660964a402c766c92225c
    docker:
      - image: notnoopci/php:7.1.5-browsers
    working_directory: ~/repo
    steps:
      - checkout
      - run: sudo pecl channel-update pecl.php.net
      - run: sudo pecl install xdebug && sudo docker-php-ext-enable xdebug
      - run: composer self-update
      - restore_cache:
          keys:
            - composer-v1-{{ checksum "composer.json" }}
            - composer-v1-
      - run: composer install -n --prefer-dist
      - save_cache:
          key: composer-v1-{{ checksum "composer.json" }}
          paths:
            - vendor
      - run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
      - run: chmod +x ./cc-test-reporter
      - run: sudo mkdir -p $CIRCLE_TEST_REPORTS/phpunit
      - run: ./cc-test-reporter before-build
      - run: sudo vendor/bin/phpunit --coverage-clover $CIRCLE_TEST_REPORTS/phpunit/clover.xml
      - run: ./cc-test-reporter after-build -t clover -p $CIRCLE_TEST_REPORTS/phpunit/ --exit-code $?

Update pecl and set cc-test-reporter prefix
Update pecl and set cc-test-reporter prefix
