djunehor/laravel-bible

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
  build:
    environment:
      CC_TEST_REPORTER_ID: 52336ab7c12c7f9c3af8305792a9a87174689d033f7aa83ce4cc5436d65dae0c
    docker:
      # Specify the version you desire here
      - image: circleci/php:7.2-node-browsers

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # Using the RAM variation mitigates I/O contention
      # for database intensive operations.
      # - image: circleci/mysql:5.7-ram
      #
      # - image: redis:2.8.19

    steps:
      - checkout

      - run: sudo apt update # PHP CircleCI 2.0 Configuration File# PHP CircleCI 2.0 Configuration File sudo apt install zlib1g-dev libsqlite3-dev
      - run: sudo docker-php-ext-install zip

      # Download and cache dependencies
      - restore_cache:
          keys:
            # "composer.lock" can be used if it is committed to the repo
            - v1-dependencies-{{ checksum "composer.json" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-

      - run: composer install -n --prefer-dist

      - save_cache:
          key: v1-dependencies-{{ checksum "composer.json" }}
          paths:
            - ./vendor

      # run tests with phpunit or codecept
      - run: ./vendor/bin/phpunit --coverage-clover=coverage.clover
      - 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 docker-php-ext-enable xdebug
      - run: ./cc-test-reporter before-build
      - run: sudo vendor/bin/phpunit --coverage-clover clover.xml
      - run: ./cc-test-reporter after-build --coverage-input-type clover --exit-code $?