-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
58 lines (55 loc) · 1.22 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
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5'))
timeout(time: 1, unit: 'HOURS')
skipStagesAfterUnstable()
}
stages {
stage('Clean workspace') {
steps {
deleteDir()
sh 'ls -lah'
}
}
stage('Checkout source') {
steps {
checkout scm
}
}
stage('Build') {
steps {
timeout(time: 30) {
sh 'mkdir -p build && cd build && cmake .. && make'
}
}
}
stage('Test') {
steps {
sh ' cd build && tests/testfoo --gtest_output="xml:testresults.xml" && mkdir reports && mv testresults.xml reports/ '
echo 'ls: $(ls)'
}
}
stage('Artifact') {
parallel {
stage('Artifact') {
steps {
sh 'ls -lah'
archiveArtifacts(onlyIfSuccessful: true, artifacts: 'build/bin/*, bin/*')
}
}
stage('Code Analysis') {
steps {
sh '''cppcheck --xml --xml-version=2 --enable=all --inconclusive --language=c++ *.cpp 2> build/reports/cppcheck.xml
'''
}
}
}
}
}
post {
always {
junit 'build/reports/*.xml'
}
}
}