-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
64 lines (63 loc) · 3.12 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
#!/usr/bin/env groovy
pipeline {
agent any
environment {
PATH = "/opt/infer/bin:$PATH"
}
stages {
stage('Clean') {
steps {
sh 'gradle clean'
dir('client') {
dir('node_modules') {
deleteDir()
}
sh 'npm install'
}
}
}
stage('Build') {
steps {
sh 'infer capture -- gradle build'
dir('client') {
sh 'npm run-script build'
sh 'npm run-script test -- --watch=false --code-coverage --browsers ChromeHeadless'
}
}
}
stage('Static code analysis') {
steps {
sh 'gradle pmd pmdMain'
sh 'gradle checkstyle checkstyleMain'
sh 'gradle spotbugs spotbugsMain'
dir('client') {
sh "mkdir -p checkstyle"
sh "rm -f checkstyle/main.xml"
sh "npm run-script lint -- --format checkstyle --force true | awk '{if(NR > 4) print \$0}' > checkstyle/main.xml"
}
}
}
stage('Integration tests') {
steps {
sh 'gradle integrationTest'
}
}
stage('Infer') {
steps {
sh 'infer analyze --pmd-xml || true'
}
}
stage("Reports") {
steps {
junit '**/build/test-results/test/*.xml'
jacoco changeBuildStatus: true, exclusionPattern: ' **/*Test*.class, **/*IT.class, **/model/**/Q*.class', maximumBranchCoverage: '60', maximumClassCoverage: '70', maximumComplexityCoverage: '60', maximumInstructionCoverage: '60', maximumLineCoverage: '60', maximumMethodCoverage: '60', minimumBranchCoverage: '40', minimumClassCoverage: '50', minimumComplexityCoverage: '40', minimumInstructionCoverage: '40', minimumLineCoverage: '40', minimumMethodCoverage: '40'
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'client/coverage/cobertura.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '**/spotbugs/main.xml', unHealthy: ''
checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/checkstyle/main.xml', unHealthy: ''
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/pmd/main.xml, infer-out/report.xml', unHealthy: ''
openTasks canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME,HACK', ignoreCase: true, low: 'NOTE', normal: 'TODO', pattern: '**/*java,client/src/**/*.ts', unHealthy: ''
dry canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/build/**/cpd/cpdCheck.xml', unHealthy: ''
}
}
}
}