Checkout Config
before_commands:
- "composer install"
checks:
php: true
build:
tests:
override:
-
command: 'vendor/bin/phpunit --coverage-clover=clover.xml'
coverage:
file: 'clover.xml'
format: 'clover'
environment:
timezone: 'Europe/Amsterdam'
php:
version: '7.1'
ini:
'date.timezone': 'Europe/Amsterdam'
# Run after dependencies
project_setup:
before: []
override: []
after: []
nodes:
tests: true
analysis:
tests:
override:
-
command: phpcs-run --standard=phpcs.xml
use_website_config: false
- php-scrutinizer-run
build_failure_conditions:
# No critical issue is introduced (existing ones are tolerated)
- 'issues.label("coding-style").exists'
# No new critical issue is introduced (existing ones are tolerated)
- 'issues.label("coding-style").new.exists'
# No critical issue is present
- 'issues.severity(= MINOR).exists'
# No new critical issue is introduced (existing ones are tolerated)
- 'issues.severity(= MINOR).new.exists'
# Class has no tests
- 'classes.metric("php_code_coverage.coverage", = 0).exists'
# Rating is C or worse for existing classes
- 'elements.rating(<= C).exists'
# Rating is C or worse is introduced
- 'elements.rating(<= C).new.exists'
- 'project.metric("scrutinizer.quality", < 9)' # Code Quality Rating drops below 9
- 'project.metric("scrutinizer.test_coverage", < 0.85)' # Code Coverage drops below 85%
# Code Coverage decreased from previous inspection by more than 5%
- 'project.metric_change("scrutinizer.test_coverage", < -0.05)'
Repository Config
# language: php
# tests: true