forked from sevenbitbyte/ros-teensy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (62 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
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
pipeline {
agent any
environment {
PACKAGE_NAME = 'ros_teensy'
ROS_WORKSPACE = "${WORKSPACE}_ws"
}
stages {
stage('Setup') {
steps {
sh 'printenv'
sh """
mkdir -p ${ROS_WORKSPACE}/src
cp -R . ${ROS_WORKSPACE}/src/${PACKAGE_NAME}
"""
}
}
stage('Build') {
steps {
dir(path: "${ROS_WORKSPACE}") {
sh '''
. /opt/ros/melodic/setup.sh
catkin build --no-status --verbose
'''
}
}
}
stage('Test') {
steps {
dir(path: "${ROS_WORKSPACE}") {
sh '''
. /opt/ros/melodic/setup.sh
. devel/setup.sh
catkin run_tests
catkin_test_results build --verbose
'''
}
}
}
stage('Lint') {
steps {
sh '''
. /opt/ros/melodic/setup.sh
catkin lint --explain -W2 --strict .
'''
}
}
}
post {
always {
dir(path: "${ROS_WORKSPACE}") {
archiveArtifacts(artifacts: "logs/**/*.log", fingerprint: true)
script {
def files = findFiles glob: 'build/**/test_results/**/*.xml'
if (files.length > 0) {
junit 'build/**/test_results/**/*.xml'
}
}
}
sh "rm -rf ${ROS_WORKSPACE}"
}
}
}