.circleci/config.yml
version: 2
workflows:
version: 2
testing:
jobs:
- test
jobs:
test:
docker:
- image: circleci/php:7.2-fpm
working_directory: ~/repo
steps:
- run:
name: "Install composer"
command: |
wget https://raw.githubusercontent.com/composer/getcomposer.org/35ca72b506eba32c0baed4d283a5f834968e5ade/web/installer -O - -q | php -- --quiet
sudo mv ./composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
- checkout
- restore_cache:
keys:
- composer-dev-v1-{{ checksum "composer.json" }}
- run: composer install --classmap-authoritative
- save_cache:
paths:
- ./vendor
key: composer-dev-v1-{{ checksum "composer.json" }}
- run: if [ -f vendor/bin/phpunit ]; then vendor/bin/phpunit; fi
- run: if [ -f vendor/bin/pharmacist ]; then vendor/bin/pharmacist; fi
- run: if [ -f vendor/bin/phpstan ]; then php -d memory_limit=4G vendor/bin/phpstan analyse -l 0 src $(if [ -f phpstan.neon ]; then echo "-c phpstan.neon"; fi); fi