.gitlab-ci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. stages:
  2. #- analysis
  3. - build
  4. #- test
  5. .build_template: &job_definition
  6. stage: build
  7. before_script:
  8. - env
  9. - apt update
  10. - apt install -y wget curl tar
  11. - wget https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.sh
  12. - chmod +x cmake-3.29.6-linux-x86_64.sh
  13. - ./cmake-3.29.6-linux-x86_64.sh --skip-license --prefix=/usr/local
  14. script:
  15. - echo $USER --- $HOME
  16. - cmake --version
  17. - echo Working directory $PWD
  18. - apt install -y python3-pip python3-setuptools rpm ${ADDITIONAL_PACKAGES}
  19. - pip3 install conan ${ADDITIONAL_PYTHON_PACKAGES} ${ADDITIONAL_PIP3_ARGS}
  20. - mkdir -p build && cd build
  21. - conan profile detect --force
  22. - conan install --build missing -s:h "&:build_type=${BUILD_TYPE}" -s "compiler.cppstd=20" -s compiler.libcxx=libstdc++11 -of=$PWD ../conanfile.txt
  23. - cmake .. --preset conan-$(echo "${BUILD_TYPE}" | tr '[:upper:]' '[:lower:]')
  24. - cmake --build . --parallel $(nproc)
  25. - ctest
  26. - export TZ="America/New_York"
  27. - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
  28. - if [[ ${BUILD_TYPE} == "Debug" ]]; then apt install -y gcovr; fi
  29. - if [[ ${BUILD_TYPE} == "Debug" ]]; then cmake --build . --target coverage; fi
  30. # Build a debian Package
  31. - cpack -G DEB
  32. # Build an RPM package
  33. - cpack -G RPM
  34. - mkdir -p ../artifacts
  35. - mv *.deb *.rpm ../artifacts
  36. artifacts:
  37. paths:
  38. - artifacts/*
  39. expire_in: 1 week
  40. build-jammy-gcc11:
  41. <<: *job_definition # Merge the contents of the 'job_definition' alias
  42. image: ubuntu:jammy
  43. variables:
  44. ADDITIONAL_PACKAGES: 'gcc g++'
  45. CC: '/usr/bin/gcc-11'
  46. CXX: '/usr/bin/g++-11'
  47. BUILD_TYPE: 'Debug'
  48. ADDITIONAL_PYTHON_PACKAGES: ''
  49. ADDITIONAL_CMAKE_FLAGS: ''
  50. ADDITIONAL_CONAN_FLAGS: '-s compiler.libcxx=libstdc++11'
  51. artifacts:
  52. paths:
  53. - build/coverage/
  54. coverage: '/^TOTAL.*\s+(\d+\%)$/'
  55. build-jammy-clang14:
  56. <<: *job_definition # Merge the contents of the 'job_definition' alias
  57. image: ubuntu:jammy
  58. variables:
  59. ADDITIONAL_PACKAGES: 'clang'
  60. CC: '/usr/bin/clang'
  61. CXX: '/usr/bin/clang++'
  62. BUILD_TYPE: 'Release'
  63. ADDITIONAL_PYTHON_PACKAGES: ''
  64. ADDITIONAL_CMAKE_FLAGS: ''
  65. ADDITIONAL_CONAN_FLAGS: '-s compiler.libcxx=libstdc++11'
  66. build-noble-gcc13:
  67. <<: *job_definition # Merge the contents of the 'job_definition' alias
  68. image: ubuntu:noble
  69. variables:
  70. ADDITIONAL_PACKAGES: 'gcc g++'
  71. CC: '/usr/bin/gcc-13'
  72. CXX: '/usr/bin/g++-13'
  73. BUILD_TYPE: 'Release'
  74. ADDITIONAL_PYTHON_PACKAGES: ''
  75. ADDITIONAL_CMAKE_FLAGS: ''
  76. ADDITIONAL_CONAN_FLAGS: '-s compiler.libcxx=libstdc++11'
  77. ADDITIONAL_PIP3_ARGS: '--break-system-packages'
  78. build-noble-clang18:
  79. <<: *job_definition # Merge the contents of the 'job_definition' alias
  80. image: ubuntu:noble
  81. variables:
  82. ADDITIONAL_PACKAGES: 'clang'
  83. CC: '/usr/bin/clang'
  84. CXX: '/usr/bin/clang++'
  85. BUILD_TYPE: 'Release'
  86. ADDITIONAL_PYTHON_PACKAGES: ''
  87. ADDITIONAL_CMAKE_FLAGS: ''
  88. ADDITIONAL_CONAN_FLAGS: '-s compiler.libcxx=libstdc++11'
  89. ADDITIONAL_PIP3_ARGS: '--break-system-packages'