Package list votca-xtp / debian/1.6.1-1 tutorials / .gitlab-ci.yml
debian/1.6.1-1

Tree @debian/1.6.1-1 (Download .tar.gz)

.gitlab-ci.yml @debian/1.6.1-1raw · history · blame

stages:
  - canary
  - build

.build_script:
  retry:
    max: 2
  variables:
    CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
  stage: build
  artifacts:
    paths:
      - ${CI_PROJECT_DIR}/votca
    when: always
  dependencies: []
  cache:
    paths:
      - ccache/
  script:
    - ccache -z
    - j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++))
    - git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA}
    - git clone https://github.com/votca/votca
    - pushd votca
    - if [[ ${CI_COMMIT_TAG} = v[12].[0-9]* ]]; then
        git checkout -b ${CI_COMMIT_TAG} ${CI_COMMIT_TAG};
      elif [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then
        git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]};
      fi
    - git submodule update --recursive --init
    - git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID}
    - git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID}
    - git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA}
    - mkdir -p build
    - pushd build
    - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON
      -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
      -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install}
      -DWITH_MKL=${WITH_MKL} -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL}
      -DUSE_CUDA=${USE_CUDA}      
    - cmake --build . -- -j2
    - ctest --output-on-failure
    - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --build . --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install
    - sudo cmake --build . --target install
    - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi
    - ccache -s

.build:
  variables:
    DISTRO: "latest"
  image: votca/buildenv:${DISTRO}
  extends: .build_script
    
Debug GCC:
  stage: canary
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Debug"
    CLANG_FORMAT: "yes"
  extends: .build

None GCC:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: ""
  extends: .build

None Clang:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: ""
  extends: .build

Debug Clang:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Debug"
  extends: .build

Release GCC:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Release"
  extends: .build

Release Clang:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Release"
  extends: .build

Debug GCC Ubuntu:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Debug"
    DISTRO: "ubuntu"
  extends: .build

Debug Clang Ubuntu:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Debug"
    DISTRO: "ubuntu"
  extends: .build

Release GCC Ubuntu:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Release"
    DISTRO: "ubuntu"
  extends: .build

Release Clang Ubuntu:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Release"
    DISTRO: "ubuntu"
  extends: .build

Debug GCC Rawhide:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Debug"
    DISTRO: "fedora_rawhide"
  extends: .build
  allow_failure: true

Debug Clang Rawhide:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Debug"
    DISTRO: "fedora_rawhide"
  extends: .build
  allow_failure: true

Release GCC Rawhide:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Release"
    DISTRO: "fedora_rawhide"
  extends: .build
  allow_failure: true

Release Clang Rawhide:
  variables:
    CC: "clang"
    CXX: "clang++"
    CMAKE_BUILD_TYPE: "Release"
    DISTRO: "fedora_rawhide"
  extends: .build
  allow_failure: true

Release GCC Module:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Release"
    MODULE_BUILD: "yes"
  extends: .build

Debug GPU Ubuntu:
  variables:
    CC: "gcc"
    CXX: "g++"
    CMAKE_BUILD_TYPE: "Debug"
    USE_CUDA: "yes"
    WITH_MKL: "no"
    DISABLE_MKL: "yes"
    NO_INSTALL: "yes"
  before_script:
    - source /opt/gromacs-2019/bin/GMXRC.bash
  extends: .build_script
  allow_failure: true
  tags:
    - gpu