From fe8c3ef3cbb9670335a8fdc31af552730baa8da2 Mon Sep 17 00:00:00 2001 From: David Tellenbach Date: Wed, 19 Aug 2020 18:27:45 +0000 Subject: Add possibility to split test suit build targets and improved CI configuration - Introduce CMake option `EIGEN_SPLIT_TESTSUITE` that allows to divide the single test build target into several subtargets - Add CI pipeline for merge request that can be run by GitLab's shared runners - Add nightly CI pipeline --- ci/CTest2JUnit.xsl | 120 +++++++++++++++++++++++++++++++++++++++ ci/build-tests.gitlab-ci.yml | 131 +++++++++++++++++++++++++++++++++++++++++++ ci/run-tests.gitlab-ci.yml | 128 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 379 insertions(+) create mode 100644 ci/CTest2JUnit.xsl create mode 100644 ci/build-tests.gitlab-ci.yml create mode 100644 ci/run-tests.gitlab-ci.yml (limited to 'ci') diff --git a/ci/CTest2JUnit.xsl b/ci/CTest2JUnit.xsl new file mode 100644 index 000000000..8ba21f4e6 --- /dev/null +++ b/ci/CTest2JUnit.xsl @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BuildName: + BuildStamp: + Name: + Generator: + CompilerName: + OSName: + Hostname: + OSRelease: + OSVersion: + OSPlatform: + Is64Bits: + VendorString: + VendorID: + FamilyID: + ModelID: + ProcessorCacheSize: + NumberOfLogicalCPU: + NumberOfPhysicalCPU: + TotalVirtualMemory: + TotalPhysicalMemory: + LogicalProcessorsPerPhysical: + ProcessorClockFrequency: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ci/build-tests.gitlab-ci.yml b/ci/build-tests.gitlab-ci.yml new file mode 100644 index 000000000..2b69b2841 --- /dev/null +++ b/ci/build-tests.gitlab-ci.yml @@ -0,0 +1,131 @@ +.build-tests-base: + stage: build + image: ubuntu:18.04 + before_script: + - apt-get update -y + - apt-get install -y --no-install-recommends software-properties-common + - add-apt-repository -y ppa:ubuntu-toolchain-r/test + - apt-get update + - apt-get install --no-install-recommends -y ${EIGEN_CI_CXX_COMPILER} ${EIGEN_CI_CC_COMPILER} cmake ninja-build + script: + - mkdir -p ${BUILDDIR} && cd ${BUILDDIR} + - echo "CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_SPLIT_TESTSUITE=${EIGEN_CI_TESTSUITE_SIZE} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} ${EIGEN_CI_ADDITIONAL_ARGS} .." + - CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_SPLIT_TESTSUITE=${EIGEN_CI_TESTSUITE_SIZE} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} ${EIGEN_CI_ADDITIONAL_ARGS}.. + - echo "cmake --build . --target buildtestspart${EIGEN_CI_TESTSUITE_PART}" + - cmake --build . --target buildtestspart${EIGEN_CI_TESTSUITE_PART} + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" + paths: + - ${BUILDDIR}/ + expire_in: 5 days + +# Base for all build jobs building the whole testsuite in one job. Note that +# this cannot be run on GitLab's shared runners due to their timeout. +.build-tests-single-base: + extends: .build-tests-base + script: + - mkdir -p ${BUILDDIR} && cd ${BUILDDIR} + - echo "CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} ${EIGEN_CI_CXX_FLAGS} ${EIGEN_CI_ADDITIONAL_ARGS}.." + - CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} ${EIGEN_CI_ADDITIONAL_ARGS}.. + - echo "cmake --build . --target buildtests" + - cmake --build . --target buildtests + tags: + - eigen-runner + - x86 + - linux + only: + - schedules + +# Base for all build jobs using a splitted testsuite such that the job can be +# run on GitLab's own shared runners +.build-tests-split-base: + extends: .build-tests-base + script: + - mkdir -p ${BUILDDIR} && cd ${BUILDDIR} + - echo "CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_SPLIT_TESTSUITE=${EIGEN_CI_TESTSUITE_SIZE} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} ${EIGEN_CI_CXX_FLAGS} -DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On .." + - CXX=${EIGEN_CI_CXX_COMPILER} CC=${EIGEN_CI_CC_COMPILER} cmake -G ${EIGEN_CI_CMAKE_GENEATOR} -DEIGEN_SPLIT_TESTSUITE=${EIGEN_CI_TESTSUITE_SIZE} -DEIGEN_TEST_CXX11=${EIGEN_TEST_CXX11} -DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On .. + - echo "cmake --build . --target buildtestspart${EIGEN_CI_TESTSUITE_PART}" + - cmake --build . --target buildtestspart${EIGEN_CI_TESTSUITE_PART} + only: + - merge_requests + +########################## Nightly running jobs ################################ + +# GCC 4.8 +# This is the oldest GCC version we support +build-tests-g++-4.8-cxx11-on: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-4.8" + EIGEN_CI_CC_COMPILER: "gcc-4.8" + EIGEN_TEST_CXX11: "on" + +build-tests-g++-4.8-cxx11-off: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-4.8" + EIGEN_CI_CC_COMPILER: "gcc-4.8" + EIGEN_TEST_CXX11: "off" + +# Clang 10 +build-tests-clang++-10-cxx11-on: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "clang++-10" + EIGEN_CI_CC_COMPILER: "clang-10" + EIGEN_TEST_CXX11: "on" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + +build-tests-clang++-10-cxx11-off: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "clang++-10" + EIGEN_CI_CC_COMPILER: "clang-10" + EIGEN_TEST_CXX11: "off" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + +# GCC 10 +build-tests-g++-10-cxx11-off: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-10" + EIGEN_CI_CC_COMPILER: "gcc-10" + EIGEN_TEST_CXX11: "off" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + +build-tests-g++-10-cxx11-on: + extends: .build-tests-single-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-10" + EIGEN_CI_CC_COMPILER: "gcc-10" + EIGEN_TEST_CXX11: "on" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + +########################### Merge request jobs ################################# + +# GCC 10 +build-tests-g++-9-cxx11-on-mr: + only: + - merge_requests + extends: .build-tests-split-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-9" + EIGEN_CI_CC_COMPILER: "gcc-9" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + parallel: + matrix: + - EIGEN_CI_TESTSUITE_PART: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + EIGEN_TEST_CXX11: "on" + +build-tests-g++-9-cxx11-off-mr: + only: + - merge_requests + extends: .build-tests-split-base + variables: + EIGEN_CI_CXX_COMPILER: "g++-9" + EIGEN_CI_CC_COMPILER: "gcc-9" + EIGEN_CI_ADDITIONAL_ARGS: "-DEIGEN_TEST_AVX=On -DEIGEN_TEST_AVX2=On" + parallel: + matrix: + - EIGEN_CI_TESTSUITE_PART: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] + EIGEN_TEST_CXX11: "off" diff --git a/ci/run-tests.gitlab-ci.yml b/ci/run-tests.gitlab-ci.yml new file mode 100644 index 000000000..c8ad66e7b --- /dev/null +++ b/ci/run-tests.gitlab-ci.yml @@ -0,0 +1,128 @@ +.run_tests: + allow_failure: true + stage: test + image: ubuntu:18.04 + before_script: + - apt-get update -y + - apt-get install -y --no-install-recommends software-properties-common + - add-apt-repository -y ppa:ubuntu-toolchain-r/test + - apt-get update + - apt-get install --no-install-recommends -y ${EIGEN_CI_CXX_COMPILER} ${EIGEN_CI_CC_COMPILER} cmake ninja-build xsltproc + script: + - echo "cd ${BUILDDIR} && ctest --output-on-failure --no-compress-output --build-no-clean -T test" + - cd ${BUILDDIR} && ctest --output-on-failure --no-compress-output --build-no-clean -T test + after_script: + - apt-get update -y + - apt-get install --no-install-recommends -y xsltproc + - cd ${BUILDDIR} + - xsltproc ../ci/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > "JUnitTestResults_$CI_JOB_ID.xml" + artifacts: + reports: + junit: + - ${BUILDDIR}/JUnitTestResults_$CI_JOB_ID.xml + expire_in: 5 days + +########################## Nightly running jobs ################################ +# GCC 4.8 +run-tests-g++-4.8-cxx11-on: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-4.8 + EIGEN_CI_CC_COMPILER: gcc-4.8 + needs: [ "build-tests-g++-4.8-cxx11-on" ] + tags: + - eigen-runner + - x86 + - linux + +run-tests-g++-4.8-cxx11-off: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-4.8 + EIGEN_CI_CC_COMPILER: gcc-4.8 + needs: [ "build-tests-g++-4.8-cxx11-off" ] + tags: + - eigen-runner + - x86 + - linux + +# Clang 10 +run-tests-clang++-10-cxx11-on: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: clang++-10 + EIGEN_CI_CC_COMPILER: clang-10 + needs: [ "build-tests-clang++-10-cxx11-on" ] + tags: + - eigen-runner + - x86 + - linux + +run-tests-clang++-10-cxx11-off: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: clang++-10 + EIGEN_CI_CC_COMPILER: clang-10 + needs: [ "build-tests-clang++-10-cxx11-off" ] + tags: + - eigen-runner + - x86 + - linux + +# GCC 10 +run-tests-g++-10-cxx11-on: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-10 + EIGEN_CI_CC_COMPILER: gcc-10 + needs: [ "build-tests-g++-10-cxx11-on" ] + tags: + - eigen-runner + - x86 + - linux + +run-tests-g++-10-cxx11-off: + only: + - schedules + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-10 + EIGEN_CI_CC_COMPILER: gcc-10 + needs: [ "build-tests-g++-10-cxx11-off" ] + tags: + - eigen-runner + - x86 + - linux + +########################### Merge request jobs ################################# + +# GCC 10 +run-tests-g++-9-cxx11-on-mr: + only: + - merge_requests + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-9 + EIGEN_CI_CC_COMPILER: gcc-9 + dependencies: + - build-tests-g++-9-cxx11-on-mr + +run-tests-g++-9-cxx11-off-mr: + only: + - merge_requests + extends: .run_tests + variables: + EIGEN_CI_CXX_COMPILER: g++-9 + EIGEN_CI_CC_COMPILER: gcc-9 + dependencies: + - build-tests-g++-9-cxx11-off-mr -- cgit v1.2.3