-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
73 lines (62 loc) · 2.42 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
68
69
70
71
72
73
/*
SPDX-License-Identifier: MPL-2.0-no-copyleft-exception
This Source Code Form is subject to the terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not distributed with this file, You can obtain one
at http://mozilla.org/MPL/2.0/.
This Source Code Form is "Incompatible With Secondary Licenses", as defined by
the Mozilla Public License, v. 2.0.
Copyright © 2021 Eduardo Garre Muñoz
*/
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 30, unit: 'SECONDS')
}
parameters {
booleanParam name: 'EJECUTA_COMPROBACIONES', defaultValue: true, description: '¿Hago Pruebas?'
booleanParam name: 'ANALISIS_ESTATICO', defaultValue: true, description: '¿Analizo el codigo?'
//booleanParam name: 'INSTALA', defaultValue: true, description: '¿Instalo los artefactos?'
}
stages {
stage('Construye') {
steps {
sh label: 'ConstruyeObra', script: 'rm -rf obra'
sh label: 'ConstruyeObra', script: 'mkdir obra'
sh label: 'EjecutaCMake', script: 'cmake CXXFLAGS="-ggdb3" -S . -B obra'
sh label: 'EjecutaCMakeBuild', script: 'cmake --build obra --parallel=$(nproc)'
}
}
stage('Analiza') {
when {
environment name: 'ANALISIS_ESTATICO', value: 'true'
}
steps {
sh label: '', returnStatus: true, script: 'echo "{nat a; apaga();}" | valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -v proyecto/compilador'
}
}
stage('Prueba') {
when {
environment name: 'EJECUTA_COMPROBACIONES', value: 'true'
}
steps {
//ctest 'InSearchPath'
sh label: 'EjecutaGoogleTest', script: 'proyecto/pruebas --gtest_output=xml:resultado.xml'
}
post {
always {
junit testResults: 'resultado.xml', allowEmptyResults: false
}
}
}
//stage('Instala') {
// when {
// environment name: 'INSTALA', value: 'true'
// }
// steps {
// sh label: '', returnStatus: true, script: '''cp jenkinsexample ~
// cp test/testPro ~'''
// }
//}
}
}