Files
CocoaTweet/Jenkinsfile
T
2021-03-01 11:36:33 +09:00

72 lines
1.1 KiB
Groovy

def unittestBadge = addEmbeddableBadgeConfiguration(id: "unittest", subject: "unit test")
pipeline {
agent {
dockerfile true
}
stages{
stage("parallel execution"){
parallel{
stage("doxygen"){
steps{
sh 'doxygen'
}
}
stage("validation"){
steps{
sh 'tools/validate/includeGuard.sh'
}
}
stage("build and test"){
stages{
stage("prepare"){
steps{
sh '''
mkdir -p build
cd build
cmake .. -G Ninja
'''
}
}
stage("build"){
steps{
sh '''
cd build
ninja
'''
}
}
stage("test"){
steps{
script{
unittestBadge.setStatus('running')
try{
sh '''
cd build
ctest --output_on_failure
'''
}catch(Exception error){
unittestBadge.setStatus('failed')
error 'unittest failed'
}
}
}
}
}
}
}
}
stage("upload artifact"){
steps{
archiveArtifacts allowEmptyArchive: true, artifacts: 'help/**/*.*', onlyIfSuccessful: true
}
}
}
}