.circleci/config.yml
version: 2
jobs:
build:
environment:
APP_ENV: test
docker:
- image: k911/php7.1-cli-xdebug:0.0.2
working_directory: ~/app
steps:
- run:
name: Show enviroment informations
command: |
php --version
composer --version
- checkout
- restore_cache:
keys:
- composer-v1-{{ arch }}-{{ .Branch }}-{{ checksum "composer.json" }}
- composer-v1-{{ arch }}-{{ .Branch }}
- composer-v1-{{ arch }}
- composer-v1
- run: composer install -n --prefer-dist
- run:
name: Configure cc-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- save_cache:
key: composer-v1-{{ arch }}-{{ .Branch }}-{{ checksum "composer.json" }}
paths:
- vendor
- save_cache:
key: composer-v1-{{ arch }}-{{ .Branch }}
paths:
- vendor
- save_cache:
key: composer-v1-{{ arch }}
paths:
- vendor
- save_cache:
key: composer-v1
paths:
- vendor
- run:
name: Tests with code coverage
command: |
./cc-test-reporter before-build
vendor/bin/phpunit --coverage-clover clover.xml
./cc-test-reporter after-build -t clover --exit-code $?
- run:
name: Code-style analysis
command: vendor/bin/php-cs-fixer fix src/ -v --diff --dry-run --allow-risky=yes;