-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
33 lines (31 loc) · 1021 Bytes
/
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
pipeline {
agent {
label 'oracle-vm'
}
environment {
CMAKE_HOME = '/usr/local/bin' // Update this path to the correct location of the CMake executable
MAKE_HOME = '/usr/bin' // Update this path to the correct location of the CMake executable
SOURCE_DIR = "$WORKSPACE/projects" // Use the Jenkins workspace directory as the source code directory
SOURCE_BINARY_DIR = "$WORKSPACE/projects/build" // Use the Jenkins workspace directory as the source code directory
}
stages {
stage('Build') {
steps {
// Navigate to the source code directory
dir(env.SOURCE_DIR) {
sh "${env.CMAKE_HOME}/cmake --version"
sh "${env.CMAKE_HOME}/cmake -B build -S ."
sh "${env.CMAKE_HOME}/cmake --build build"
}
}
}
stage('Unit Tests') {
steps {
dir(env.SOURCE_BINARY_DIR) {
sh "${env.CMAKE_HOME}/ctest -C checkin --output-junit unittest.xml"
junit '**/*.xml'
}
}
}
}
}