pipeline { agent { dockerfile { filename 'Dockerfile' dir 'build' } } parameters { booleanParam(name: 'CLEAN', defaultValue: false, description: 'Clean build') booleanParam(name: 'RUN_TESTS', defaultValue: true, description: 'Run tests') } stages { stage('Clean') { when { expression { params.CLEAN } } steps { sh 'rm -rf cache/*' } } stage('Prepare') { steps { script { // generate the compile commands for clang-tidy to work with and update repositories (mijin) sh 'scons -Q --unity=disable --compiler=clang compile_commands.json --update_repositories' } } } stage('Clang-Tidy') { when { expression { params.RUN_TESTS } } steps { warnError('clang-tidy found problems.') { sh 'bash build/scripts/clang-tidy.sh' } } } stage('Build Linux Clang') { steps { sh 'scons -j8 --build_type=debug --variant=linux_clang_debug --compiler=clang' sh 'scons -j8 --build_type=release_debug --variant=linux_clang_release_debug --compiler=clang' sh 'scons -j8 --build_type=release --variant=linux_clang_release --compiler=clang' } } stage('Build Linux GCC') { steps { script { def config = 'CC="gcc-13"\nCXX="g++-13"' writeFile file: 'config.py', text: config } sh 'scons -j8 --build_type=debug --variant=linux_gcc_debug' sh 'scons -j8 --build_type=release_debug --variant=linux_gcc_release_debug' sh 'scons -j8 --build_type=release --variant=linux_gcc_release' } } stage('Archive') { steps { archiveArtifacts artifacts: 'bin_*/*', fingerprint: true, onlyIfSuccessful: true } } } post { failure { mail from: 'Jenkins ', to: 'buildresult@mewin.de', cc: '', bcc: '', subject: "Jenkins Build Error (${env.JOB_NAME})", body: "Build Failure
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}", charset: 'UTF-8', mimeType: 'text/html', replyTo: ''; } } }