forked from ringmaster/dicecalc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
29 lines (29 loc) · 1.33 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
node {
stage 'Checkout'
checkout scm
stage 'Download Composer'
sh "wget -q https://getcomposer.org/download/1.1.1/composer.phar -O composer.phar"
stage 'Install dependencies'
sh "php -f composer.phar -- install"
stage 'Run tests'
sh "./vendor/bin/phpunit -c phpunit.xml.dist"
stage 'Run metrics'
sh "if [ ! -d ./reports ]; then mkdir ./reports ; fi"
parallel (
phploc: {
sh "./vendor/bin/phploc --log-xml ./reports/phploc.xml ./src || true"
},
phpmd: {
sh "./vendor/bin/phpmd ./src xml cleancode,codesize,controversial,design,naming,unusedcode --reportfile ./reports/pmd.xml --exclude *TestsDataFixtures*,*TestCase.php,*Test.php || true"
},
phpcpd: {
sh "./vendor/bin/phpcpd --log-pmd ./reports/pmd-cpd.xml ./src || true"
},
phpcs: {
sh "./vendor/bin/phpcs --report=checkstyle --extensions=php --encoding=utf-8 --report-file=./reports/checkstyle.xml ./src || true"
}
)
step([$class: 'PmdPublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'reports/pmd.xml', unHealthy: ''])
step([$class: 'CheckStylePublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'reports/checkstyle.xml', unHealthy: ''])
step([$class: 'PmdPublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'reports/pmd-cpd.xml', unHealthy: ''])
}