diff --git a/Jenkinsfile b/Jenkinsfile index 9ba966a7..3ebe5751 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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]) } } } } +