Update Jenkinsfile for dockerized build environment (#1240)

1008-fix
krzys_h 2019-02-18 19:18:53 +01:00 committed by GitHub
parent a46750ede2
commit e02a3373fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 7 deletions

28
Jenkinsfile vendored
View File

@ -1,7 +1,7 @@
#!/usr/bin/env groovy
pipeline {
agent { label 'colobot-build' }
agent none
options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '20'))
}
@ -19,13 +19,17 @@ pipeline {
stage('Build') {
parallel {
stage('Build Windows') {
agent {
docker { image 'krzysh/colobot-build:latest' }
}
steps {
sh 'mkdir -p build/windows'
dir('build/windows') {
sh '''
cmake \
# FIXME: without -lsetupapi linking sdl2 fails
/opt/mxe/usr/bin/i686-w64-mingw32.static-cmake \
-DCMAKE_CXX_STANDARD_LIBRARIES="-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lsetupapi" \
-DCMAKE_INSTALL_PREFIX=/install \
-DCMAKE_TOOLCHAIN_FILE=/opt/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=0 ../..
make
rm -rf install
@ -42,13 +46,15 @@ pipeline {
}
stage('Build Linux') {
agent {
docker { image 'krzysh/colobot-build:latest' }
}
steps {
sh 'mkdir -p build/linux'
dir('build/linux') {
sh '''
cmake \
-DCMAKE_INSTALL_PREFIX=/install -DCOLOBOT_INSTALL_BIN_DIR=/install -DCOLOBOT_INSTALL_LIB_DIR=/install -DCOLOBOT_INSTALL_DATA_DIR=/install/data -DCOLOBOT_INSTALL_I18N_DIR=/install/lang -DCMAKE_SKIP_INSTALL_RPATH=ON \
-DBOOST_STATIC=ON -DGLEW_STATIC=ON -DGLEW_LIBRARY=/usr/lib64/libGLEW.a \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=0 ../..
make
rm -rf install
@ -68,6 +74,9 @@ pipeline {
}
stage('Generate docs') {
agent {
docker { image 'krzysh/colobot-build:latest' }
}
steps {
dir('build/linux') {
sh 'make doc'
@ -81,6 +90,9 @@ pipeline {
}
stage('Run tests') {
agent {
docker { image 'krzysh/colobot-build:latest' }
}
steps {
dir('build/linux') {
sh './colobot_ut --gtest_output=xml:gtestresults.xml || true'
@ -91,6 +103,9 @@ pipeline {
}
stage('Run colobot-lint') {
agent {
label 'colobot-build'
}
environment {
CC = '/usr/lib/llvm-3.6/bin/clang'
CXX = '/usr/lib/llvm-3.6/bin/clang++'
@ -245,11 +260,10 @@ exit $ret
}
}
// TODO: cppcheck publisher STILL doesn't have pipeline support
// There is an open pull request though, merged but no release yet... https://github.com/jenkinsci/cppcheck-plugin/pull/36
publishCppcheck pattern: 'build/lint/colobot_lint_report.xml'
publishHTML([reportName: 'Colobot-lint HTML report', reportDir: 'build/lint/html_report', reportFiles: 'index.html', reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true])
}
}
}
}