-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
67 lines (66 loc) · 2.9 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env groovy
pipeline {
agent {
label 'php7.2'
}
stages {
stage("Composer") {
steps {
sh "composer install"
}
}
stage('Test') {
parallel {
stage("Static Analysis") {
steps {
sh "composer run ci:analysis"
sh "composer run ci:analysis:tests"
}
post {
success {
recordIssues(tools: [cpd(pattern: 'reports/phpcpd*.xml'), checkStyle(pattern: 'reports/*-checkstyle*.xml'), pmdParser(pattern: 'reports/*-pmd*.xml')], unstableTotalAll: 1)
}
}
}
stage("Codeception") {
steps {
sh "composer run ci:test"
}
post {
success {
junit 'tests/_output/report.xml'
step([
$class: 'CloverPublisher',
cloverReportDir: 'tests/_output/coverage',
cloverReportFileName: '../coverage.xml',
healthyTarget: [methodCoverage: 80, conditionalCoverage: 80, statementCoverage: 80],
unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50],
failingTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50]]
)
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'tests/_output', reportFiles: 'report.html,coverage/index.html', reportName: 'Codeception report', reportTitles: 'Test overview,Code coverage'])
}
}
}
}
}
stage("Code Metrics") {
when {
branch 'master'
}
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'code-metrics-observatory']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'istudio', url: '[email protected]:degordian/code-metrics-observatory.git']]])
dir('code-metrics-observatory') {
sh "composer install"
configFileProvider([configFile(fileId: 'c3d7339a-64c3-43ed-a9f0-51a2423f267c', targetLocation: '.env.local')]) {
sh "bin/console collect transfer-object-converter ../tests/_output/report.xml"
}
}
}
}
}
options {
ansiColor("xterm")
timestamps()
timeout(time: 20, unit: 'MINUTES')
}
}