Commit 1a91fb1b authored by Marco Clemencic's avatar Marco Clemencic Committed by Charles Leggett
Browse files

Add debug builds to Gitlab-CI

parent 17f49bdd
......@@ -7,103 +7,71 @@ image: gitlab-registry.cern.ch/lhcb-core/lbdocker/centos7-build
variables:
NO_LBLOGIN: "1"
CLANG_FORMAT_VERSION: "3.9"
BINARY_TAG: "x86_64-centos7-gcc7-opt"
TARGET_BRANCH: master
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
TESTS_REPORT: "test_report"
LCG_hostos: "x86_64-centos7"
LCG_release_area: "/cvmfs/sft.cern.ch/lcg/releases"
LCG_contrib: "/cvmfs/sft.cern.ch/lcg/contrib"
BUILDDIR: "build"
TESTS_REPORT: "test_report"
before_script:
- export PATH=/cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.11.0/Linux-x86_64/bin:${LCG_contrib}/ninja/1.7.1/x86_64-slc6:${LCG_release_area}/Python/2.7.13-597a5/${BINARY_TAG}/bin:${PATH}
- export PATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/scripts:${PATH}
- export PYTHONPATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/python:${PYTHONPATH}
- export CMAKE_PREFIX_PATH=${LCG_release_area}:/cvmfs/projects.cern.ch/intelsw/psxe/linux/x86_64/2017/vtune_amplifier_xe
- export CCACHE_DIR=${PWD}/.ccache
# special environment required for LCG binutils
- export PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/bin:${PATH}
- export LD_LIBRARY_PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/lib:${LD_LIBRARY_PATH}
CLANG_FORMAT_VERSION: "3.9"
CCACHE_VERSION: "3.3.4-e92e5"
build:
build:gcc7:opt:
stage: build
tags:
- cvmfs
stage: build
variables:
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
- echo 'set(clang_format_cmd "'$(which lcg-clang-format-${CLANG_FORMAT_VERSION})'" CACHE FILEPATH "")' >> cache_preload.cmake
- make BUILDDIR=${BUILDDIR}
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
- ci-utils/build
artifacts:
paths:
- ${BUILDDIR}
- .ccache
expire_in: 1 week
build-gcc62:
build:gcc7:dbg:
stage: build
tags:
- cvmfs
stage: build
variables:
BINARY_TAG: x86_64-centos7-gcc62-opt
BUILDDIR: build-gcc62
BINARY_TAG: x86_64-centos7-gcc7-dbg
BUILDDIR: build-dbg
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
- echo 'set(clang_format_cmd "'$(which lcg-clang-format-${CLANG_FORMAT_VERSION})'" CACHE FILEPATH "")' >> cache_preload.cmake
- make BUILDDIR=${BUILDDIR}
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
- ci-utils/build
artifacts:
paths:
- ${BUILDDIR}
- .ccache
expire_in: 1 week
test_headers:
build:gcc62:opt:
stage: build
tags:
- cvmfs
stage: test
variables:
BINARY_TAG: x86_64-centos7-gcc62-opt
BUILDDIR: build-gcc62
script:
- curl -o artifacts.zip --location ${CI_PROJECT_URL}/-/jobs/artifacts/master/download?job=${CI_JOB_NAME}
- unzip -q artifacts.zip '.ccache/*' || true
- ${LCG_release_area}/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -z
- export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
- make BUILDDIR=${BUILDDIR} test_public_headers_build
- /cvmfs/sft.cern.ch/lcg/releases/ccache/3.3.4-e92e5/${BINARY_TAG}/bin/ccache -s
- ci-utils/build
artifacts:
paths:
- ${BUILDDIR}
- .ccache
expire_in: 1 week
coding-conventions:
check-formatting:
stage: test
dependencies: []
tags:
- cvmfs
stage: test
variables:
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
script:
- export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
- sudo pip install autopep8==1.3.5
- make BUILDDIR=${BUILDDIR} configure
- git fetch https://gitlab.cern.ch/gaudi/Gaudi.git master
- git diff --name-only --no-renames --diff-filter MA FETCH_HEAD...HEAD | grep -E '\.(h|i?cpp|py)$' |
xargs --no-run-if-empty ${BUILDDIR}/apply-formatting || true
- "echo \"From: Gitlab CI <noreply@cern.ch>\" > apply-formatting.patch"
- "echo \"Date: $(date -R)\" >> apply-formatting.patch"
- "echo \"Subject: [PATCH] Fixed formatting\" >> apply-formatting.patch"
- echo "" >> apply-formatting.patch
- echo "patch generated by ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}" >> apply-formatting.patch
- echo "" >> apply-formatting.patch
- echo "" >> apply-formatting.patch
- git diff >> apply-formatting.patch
- git diff --stat --exit-code || (
echo -e "\n=======================================\n You can fix formatting with:\n\n"
" curl ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/apply-formatting.patch | git am"
"\n\n=======================================" ; false
)
- ci-utils/check-formatting
artifacts:
paths:
- apply-formatting.patch
......@@ -111,9 +79,17 @@ coding-conventions:
expire_in: 1 day
doxygen:
stage: test
dependencies:
- build:gcc7:opt
tags:
- cvmfs
stage: test
only:
- master
- tags
variables:
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
script:
- find build -type f -exec touch -d $(date +@%s) \{} \;
- make BUILDDIR=${BUILDDIR} doc
......@@ -121,70 +97,85 @@ doxygen:
- mkdir -p public/doxygen
- mv ${BUILDDIR}/doxygen/html ${CI_COMMIT_REF_SLUG}
- zip -r -q public/doxygen/${CI_COMMIT_REF_SLUG}.zip ${CI_COMMIT_REF_SLUG}
only:
- master
- tags
artifacts:
paths:
- public
expire_in: 1 day
test:
test:gcc7:opt:
stage: test
dependencies:
- build:gcc7:opt
tags:
- cvmfs
stage: test
variables:
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
script:
- find ${BUILDDIR} -type f -exec touch -d $(date +@%s) \{} \;
- mkdir -p ${BUILDDIR}/html
- ( make BUILDDIR=${BUILDDIR} test ARGS='-j4' || touch ${BUILDDIR}/html/tests_failed ) | tee ${BUILDDIR}/ctest.log
- mv ${BUILDDIR}/html ${TESTS_REPORT}
- mv ${BUILDDIR}/ctest.log ${TESTS_REPORT}
- mv ${BUILDDIR}/Testing ${TESTS_REPORT}
- if [ -e ${TESTS_REPORT}/tests_failed ] ; then
# this prints all lines starting with a white space after and including "The following tests...", excluding lines with "Not Run"
- echo "================================================================================"
- awk '/^[^[:space:]]/{do_print=0}; /The following tests FAILED:/{do_print=1}; do_print&&!/Not Run/{print}' ${TESTS_REPORT}/ctest.log
- echo "================================================================================"
- exit 1
- fi
- ci-utils/test
artifacts:
paths:
- ${TESTS_REPORT}
when: always
expire_in: 1 week
test-gcc62:
test:gcc7:dbg:
stage: test
dependencies:
- build:gcc7:dbg
tags:
- cvmfs
variables:
BINARY_TAG: x86_64-centos7-gcc7-dbg
BUILDDIR: build-dbg
script:
- ci-utils/test
artifacts:
paths:
- ${TESTS_REPORT}
when: always
expire_in: 1 week
test:gcc62:opt:
stage: test
dependencies:
- build:gcc62:opt
tags:
- cvmfs
variables:
BINARY_TAG: x86_64-centos7-gcc62-opt
BUILDDIR: build-gcc62
TESTS_REPORT: test_report-gcc62
script:
- find ${BUILDDIR} -type f -exec touch -d $(date +@%s) \{} \;
- mkdir -p ${BUILDDIR}/html
- ( make BUILDDIR=${BUILDDIR} test ARGS='-j4' || touch ${BUILDDIR}/html/tests_failed ) | tee ${BUILDDIR}/ctest.log
- mv ${BUILDDIR}/html ${TESTS_REPORT}
- mv ${BUILDDIR}/ctest.log ${TESTS_REPORT}
- mv ${BUILDDIR}/Testing ${TESTS_REPORT}
- if [ -e ${TESTS_REPORT}/tests_failed ] ; then
# this prints all lines starting with a white space after and including "The following tests...", excluding lines with "Not Run"
- echo "================================================================================"
- awk '/^[^[:space:]]/{do_print=0}; /The following tests FAILED:/{do_print=1}; do_print&&!/Not Run/{print}' ${TESTS_REPORT}/ctest.log
- echo "================================================================================"
- exit 1
- fi
- ci-utils/test
artifacts:
paths:
- ${TESTS_REPORT}
when: always
expire_in: 1 week
test_public_headers_build:
stage: test
dependencies:
- build:gcc7:opt
tags:
- cvmfs
variables:
BINARY_TAG: x86_64-centos7-gcc7-opt
BUILDDIR: build-opt
script:
- ci-utils/test_public_headers_build
artifacts:
paths:
- .ccache
expire_in: 1 week
# see https://gitlab.cern.ch/gitlabci-examples/deploy_eos for the details
# of the configuration
deploy-doxygen:
stage: deploy
dependencies:
- doxygen
only:
- master
- tags
......
This directory contains helper scripts for Gitlab-CI jobs.
#!/bin/bash -e
. $(dirname $0)/env_setup.sh
if [ -n "${CI}" ] ; then
url="${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_REF_NAME}/download?job=${CI_JOB_NAME}"
echo "downloading '${url}'"
curl -o artifacts.zip --location "${url}"
unzip -q artifacts.zip '.ccache/*' || true
fi
${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z
echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake
echo 'set(clang_format_cmd "'$(which lcg-clang-format-${CLANG_FORMAT_VERSION})'" CACHE FILEPATH "")' >> cache_preload.cmake
/usr/bin/time -v bash -x -e -c "
make BUILDDIR=${BUILDDIR} configure
make BUILDDIR=${BUILDDIR} BUILDFLAGS=-j4 GaudiKernel
make BUILDDIR=${BUILDDIR}
"
${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -s
#!/bin/bash -e
. $(dirname $0)/env_setup.sh
if [ -n "${CI}" ] ; then
job_id="${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}"
else
job_id="standalone job"
fi
sudo pip install autopep8==1.3.5
export LCG_release_area=${LCG_release_area}:/cvmfs/lhcb.cern.ch/lib/lcg/external
make BUILDDIR=${BUILDDIR} configure
git fetch https://gitlab.cern.ch/gaudi/Gaudi.git ${TARGET_BRANCH}
git diff --name-only --no-renames --diff-filter MA FETCH_HEAD...HEAD | grep -E '\.(h|i?cpp|py)$' | xargs --no-run-if-empty ${BUILDDIR}/apply-formatting || true
echo "From: Gitlab CI <noreply@cern.ch>" > apply-formatting.patch
echo "Date: $(date -R)" >> apply-formatting.patch
echo "Subject: [PATCH] Fixed formatting" >> apply-formatting.patch
echo "" >> apply-formatting.patch
echo "patch generated by ${job_id}" >> apply-formatting.patch
echo "" >> apply-formatting.patch
echo "" >> apply-formatting.patch
git diff >> apply-formatting.patch
git diff --stat --exit-code || ( cat <<EOF
=======================================
You can fix formatting with:
curl ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/apply-formatting.patch | git am
=======================================
EOF
false )
# default values for some variables defined in .gitlab-ci.yml
: ${TARGET_BRANCH:=master}
: ${BINARY_TAG:=x86_64-centos7-gcc7-opt}
: ${BUILDDIR:=build.${BINARY_TAG}}
: ${TESTS_REPORT:=test_report}
: ${LCG_hostos:=${BINARY_TAG%-*-*}}
: ${LCG_release_area:=/cvmfs/sft.cern.ch/lcg/releases}
: ${LCG_contrib:=/cvmfs/sft.cern.ch/lcg/contrib}
: ${CLANG_FORMAT_VERSION:=3.9}
: ${CCACHE_VERSION:=3.3.4-e92e5}
# initial required environment
export PATH=/cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.11.0/Linux-x86_64/bin:${LCG_contrib}/ninja/1.7.1/x86_64-slc6:${LCG_release_area}/Python/2.7.13-597a5/${BINARY_TAG}/bin${PATH:+:$PATH}
export PATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/scripts:${PATH}
export PYTHONPATH=/cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/dev/InstallArea/python${PYTHONPATH:+:$PYTHONPATH}
export CMAKE_PREFIX_PATH=${LCG_release_area}:/cvmfs/projects.cern.ch/intelsw/psxe/linux/x86_64/2017/vtune_amplifier_xe
export CCACHE_DIR=${PWD}/.ccache
# special environment required for LCG binutils
export PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/bin:${PATH}
export LD_LIBRARY_PATH=${LCG_contrib}/bintuils/2.28/${LCG_hostos}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
unset CMTCONFIG
#!/bin/bash -e
. $(dirname $0)/env_setup.sh
# make sure we do not re-run cmake
find ${BUILDDIR} -type f -exec touch -d $(date +@%s) \{} \;
mkdir -p ${BUILDDIR}/html
( make BUILDDIR=${BUILDDIR} test ARGS='-j4' || touch ${BUILDDIR}/html/tests_failed ) | tee ${BUILDDIR}/ctest.log
mv ${BUILDDIR}/html ${TESTS_REPORT}
mv ${BUILDDIR}/ctest.log ${TESTS_REPORT}
mv ${BUILDDIR}/Testing ${TESTS_REPORT}
if [ -e ${TESTS_REPORT}/tests_failed ] ; then
# this prints all lines starting with a white space after and including "The following tests...", excluding lines with "Not Run"
echo "================================================================================"
awk '/^[^[:space:]]/{do_print=0}; /The following tests FAILED:/{do_print=1}; do_print&&!/Not Run/{print}' ${TESTS_REPORT}/ctest.log
echo "================================================================================"
exit 1
fi
#!/bin/bash -e
. $(dirname $0)/env_setup.sh
if [ -n "${CI}" ] ; then
url="${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_REF_NAME}/download?job=${CI_JOB_NAME}"
echo "downloading '${url}'"
curl -o artifacts.zip --location "${url}"
unzip -q artifacts.zip '.ccache/*' || true
fi
# make sure we do not re-run cmake
find ${BUILDDIR} -type f -exec touch -d $(date +@%s) \{} \;
${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z
/usr/bin/time -v make BUILDDIR=${BUILDDIR} test_public_headers_build
${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -s
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment