.circleci/config.yml
version: 2.0
jobs:
build:
environment:
CC_TEST_REPORTER_ID: d66f6a48863052d6c3066ca38032c786f882ba1620d7e93e43d7861c4851e8e0
docker:
- image: "mileschou/xdebug:8.2"
working_directory: ~/repo
steps:
- run:
name: Setup dependencies
command: |
uname -a
apt update
apt upgrade -y
apt-get -y install git
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
composer self-update
- run:
name: Clone and Composer Install
command: |
git clone https://github.com/elchris/hashtuner.git
cd hashtuner
php --ini
export COMPOSER_PROCESS_TIMEOUT=600
composer config --global process-timeout 600
composer install -n --prefer-source
- run:
name: Setup Code Climate test-reporter
command: |
cd hashtuner
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
name: Run tests with coverage
command: |
cd hashtuner
export XDEBUG_MODE=coverage
./cc-test-reporter before-build
vendor/bin/phpunit --coverage-clover clover.xml
./cc-test-reporter after-build --coverage-input-type clover --exit-code $?
- run:
name: Run PHPStan Level 7
command: |
cd hashtuner
./vendor/bin/phpstan analyse src tests
- run:
name: Run PHPCS PSR-2
command: |
cd hashtuner
./vendor/bin/phpcs --standard=PSR2 --ignore=./src/index.php src tests