3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-17 08:30:35 +02:00

[jenkins] add sanitize platform build

This commit is contained in:
Dylan Simon 2021-05-28 13:11:47 -04:00
parent 89e1163f21
commit 8cc1949be0
2 changed files with 9 additions and 4 deletions

View File

@ -9,8 +9,8 @@ COPY --chown=build . $SRC/$APPNAME
WORKDIR $BUILD/$APPNAME WORKDIR $BUILD/$APPNAME
RUN chown build . RUN chown build .
USER build USER build
ARG BUILD_DOC=0
ARG BUILD_ID ARG BUILD_ID
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} -DBuild_Deps=Always && make -j2 || make -j1 VERBOSE=1 ARG CMAKE_ARGS
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Deps=Always $CMAKE_ARGS && make -j2 || make -j1 VERBOSE=1
USER root USER root
RUN make install RUN make install

9
Jenkinsfile vendored
View File

@ -25,7 +25,7 @@ def platforms = [:]
/****************** linux builds (in docker) */ /****************** linux builds (in docker) */
/* Each platform must have a cooresponding Dockerfile.PLATFORM in triqs/packaging */ /* Each platform must have a cooresponding Dockerfile.PLATFORM in triqs/packaging */
def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc"] def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "sanitize"]
/* .each is currently broken in jenkins */ /* .each is currently broken in jenkins */
for (int i = 0; i < dockerPlatforms.size(); i++) { for (int i = 0; i < dockerPlatforms.size(); i++) {
def platform = dockerPlatforms[i] def platform = dockerPlatforms[i]
@ -38,7 +38,12 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
mv -f Dockerfile.jenkins Dockerfile mv -f Dockerfile.jenkins Dockerfile
""" """
/* build and tag */ /* build and tag */
def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} --build-arg BUILD_ID=${env.BUILD_TAG} .") def args = ''
if (platform == documentationPlatform)
args = '-DBuild_Documentation=1'
else if (platform == "sanitize")
args = '-DASAN=ON -DUBSAN=ON'
def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' .")
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
img.inside() { img.inside() {
sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1" sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1"