diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c56157326e5848ef5cf3df797addd0d5eae248a7..1db76a1de4fbc1f87e3142f759dc6ca4888379db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ workflow: stages: - build + - test ############################################################################## # Template for Build and Test @@ -34,14 +35,22 @@ stages: # the test job will be failed if it is executed on a different nodes. # Therefore, put the build script and test script together. +.envvar_template: + variables: + CEPCSW_LCG_RELEASE: LCG + CEPCSW_LCG_PLATFORM: x86_64-centos7-gcc11-opt + CEPCSW_LCG_VERSION: 103.0.2 + .build_template: + extends: .envvar_template stage: build - variables: - CEPCSW_LCG_RELEASE: - CEPCSW_LCG_PLATFORM: - CEPCSW_LCG_VERSION: script: - bash ./.build.ci.sh + +.test_template: + extends: .envvar_template + stage: test + script: - bash ./.test.ci.sh ############################################################################## @@ -49,19 +58,28 @@ stages: ############################################################################## build:lcg:el7: extends: .build_template - variables: - CEPCSW_LCG_RELEASE: LCG - CEPCSW_LCG_PLATFORM: x86_64-centos7-gcc11-opt - CEPCSW_LCG_VERSION: 103.0.2 tags: - centos7 artifacts: paths: - InstallArea + - build.${CEPCSW_LCG_VERSION}.${CEPCSW_LCG_PLATFORM} + +############################################################################## +# Test CentOS 7 (LCG) +############################################################################## +test:lcg:el7: + extends: .test_template + tags: + - centos7 + artifacts: + paths: - TDR_o1_v01.tgeo.root - TDR_o1_v02.tgeo.root reports: junit: build.${CEPCSW_LCG_VERSION}.${CEPCSW_LCG_PLATFORM}/cepcsw-ctest-result.xml + dependencies: + - build:lcg:el7 ############################################################################## # Build the docs @@ -74,4 +92,4 @@ build:docs: - bash ./.build.ci.sh docs artifacts: paths: - - docs/build/html/ \ No newline at end of file + - docs/build/html/ diff --git a/.test.ci.sh b/.test.ci.sh index 45f07bafae13e32e98555ae70c8320fe8f552c4f..2e23e952f604ca6678e8378705a86eaebccf0351 100755 --- a/.test.ci.sh +++ b/.test.ci.sh @@ -43,4 +43,9 @@ echo "CEPCSW_BLDTOOL: ${CEPCSW_BLDTOOL}" source setup.sh +# reconfigure if directory change +pushd $(build-dir) +cmake .. +popd + ctest --output-junit $(junit-output) --test-dir $(build-dir) diff --git a/CMakeLists.txt b/CMakeLists.txt index 796ca71ac51cfacf51281689379960896c9a73ec..ba96443a3b5830b4168d7091caddc296ddb69dea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ endif() # By default, it is RelWithDebInfo since Sept 6th, 2024. if (NOT CMAKE_CONFIGURATION_TYPES) if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None|Release|MinSizeRel|Debug|RelWithDebInfo" FORCE) else() set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}