Add PHPStan checks to CI
All checks were successful
Gitea - aviat/banker/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2021-02-18 13:27:07 -05:00
parent d30f20c6aa
commit 94f40e6cd0
2 changed files with 23 additions and 14 deletions

24
Jenkinsfile vendored
View File

@ -9,20 +9,6 @@ pipeline {
sh 'php composer.phar install --ignore-platform-reqs' sh 'php composer.phar install --ignore-platform-reqs'
} }
} }
stage("Test PHP 7.4") {
steps {
script {
docker.image("memcached:latest").withRun("-p 11212:11211") { c ->
docker.image("redis:latest").withRun("-p 6380:6379") { d ->
docker.image("php:7.4").withRun("-e REDIS_HOST=redis -e REDIS_PORT=11212 -e MEMCACHED_HOST=mem -e MEMCACHED_PORT=6380 --link ${d.id}:redis --link ${c.id}:mem") { p ->
sh "sh build/docker_install.sh"
sh "php ./vendor/bin/phpunit -c build --no-coverage --colors=never"
}
}
}
}
}
}
stage("Test PHP 8") { stage("Test PHP 8") {
steps { steps {
script { script {
@ -37,6 +23,16 @@ pipeline {
} }
} }
} }
stage('Code Cleanliness') {
agent any
steps {
sh "php ./vendor/bin/phpstan analyse -c phpstan.neon -n --no-progress --no-ansi --error-format=checkstyle | awk '{\$1=\$1;print}' > build/logs/phpstan.log"
recordIssues(
failOnError: false,
tools: [phpStan(reportEncoding: 'UTF-8', pattern: 'build/logs/phpstan.log')]
)
}
}
} }
post { post {
success { success {

13
phpstan.neon Normal file
View File

@ -0,0 +1,13 @@
parameters:
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
inferPrivatePropertyTypeFromConstructor: true
level: 8
paths:
- src
excludes_analyse:
- tests
- vendor
# These are objects that basically can return anything
universalObjectCratesClasses:
- Aviat\Ion\Friend