.gitlab-ci.yml 3.08 KB
Newer Older
1 2 3
variables:
  PYPI_USER: SECURE
  PYPI_PASSWORD: SECURE
4
  GIT_SUBMODULE_STRATEGY: recursive
Andreas Schmidt's avatar
Andreas Schmidt committed
5

6 7 8 9 10 11
stages:
  - build
  - test
  - deploy
  - clean

12
build:prrt:
13
  stage: build
14 15
  tags:
    - cmake
16 17 18 19 20
  artifacts:
    name: "$CI_BUILD_REF_NAME$"
    untracked: true
    expire_in: "1h"
  script:
21
    - rm -vf ~/.pypirc
22 23 24
    - which cmake
    - which gcc
    - which g++
25 26 27
    - cmake --version
    - gcc --version
    - g++ --version
28 29
    - pip3 list | grep Cython
    - pip3 list | grep numpy
30
    - CC=gcc-5 CXX=g++-5 cmake . -DPRRT_TESTS=1
31 32
    - make

33
build:container:
34 35 36 37 38
    stage: build
    tags:
        - docker
    script:
        - export DOCKER_TAG=$(echo "$CI_BUILD_REF_NAME" | sed 's#/#_#' | sed 's#^master$#latest#')
39
        - docker build -t $CI_REGISTRY_IMAGE:$DOCKER_TAG --build-arg http_proxy=http://www-proxy.uni-saarland.de:3128 -f docker/Dockerfile .
40 41 42 43
        - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
        - docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
        - docker rmi $CI_REGISTRY_IMAGE:$DOCKER_TAG

Andreas Schmidt's avatar
Andreas Schmidt committed
44 45 46 47 48 49 50 51 52 53 54
build:container_tcp:
    stage: build
    tags:
        - docker
    script:
        - export DOCKER_TAG=$(echo "$CI_BUILD_REF_NAME""_tcp" | sed 's#/#_#' | sed 's#^master$#latest#')
        - docker build -t $CI_REGISTRY_IMAGE:$DOCKER_TAG --build-arg http_proxy=http://www-proxy.uni-saarland.de:3128 -f docker/Dockerfile_tcp .
        - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
        - docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
        - docker rmi $CI_REGISTRY_IMAGE:$DOCKER_TAG

55 56 57 58 59 60 61 62 63 64 65
build:container_xlap:
    stage: build
    tags:
        - docker
    script:
        - export DOCKER_TAG=$(echo "$CI_BUILD_REF_NAME""_xlap" | sed 's#/#_#' | sed 's#^master$#latest#')
        - docker build -t $CI_REGISTRY_IMAGE:$DOCKER_TAG --build-arg http_proxy=http://www-proxy.uni-saarland.de:3128 -f docker/Dockerfile_xlap .
        - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
        - docker push $CI_REGISTRY_IMAGE:$DOCKER_TAG
        - docker rmi $CI_REGISTRY_IMAGE:$DOCKER_TAG

66
test:prrt_mem:
67
  stage: test
68 69
  dependencies:
    - build:prrt
70 71
  tags:
    - valgrind
72
  script:
73
    - bash tests/memtest.sh
74

75
test:prrt_functional:
76
  stage: test
77 78
  dependencies:
    - build:prrt
79 80
  tags:
    - bash
81
  script:
82
    - exec ./prrtTests
83

84 85
test:prrt_python_bindings:
  stage: test
86
  tags:
87
    - bash
88
    - python3
89
  script:
90
    - sh tests/build.sh
91 92

deploy:pypi:
93
  stage: deploy
Andreas Schmidt's avatar
Andreas Schmidt committed
94 95
  tags:
    - python3
Andreas Schmidt's avatar
Andreas Schmidt committed
96
  script:
97 98 99 100 101 102 103 104 105
    - echo "[distutils]" >> ~/.pypirc
    - echo "index-servers =" >> ~/.pypirc
    - echo "  on" >> ~/.pypirc
    - echo " " >> ~/.pypirc
    - echo "[on]" >> ~/.pypirc
    - echo "repository=http://git.nt.uni-saarland.de:5678" >> ~/.pypirc
    - echo "username=$PYPI_USER" >> ~/.pypirc
    - echo "password=$PYPI_PASSWORD" >> ~/.pypirc
    - python3 setup.py check sdist bdist upload -r on
106
    - rm -vf ~/.pypirc
107 108 109 110 111 112

deploy:profile:
  stage: deploy
  tags:
    - gprof
  script:
113 114
    - ls -lahv
    - rm CMakeCache.txt
115 116 117 118 119 120 121 122
    - CC=gcc-5 CXX=g++-5 cmake . -DGPROF=1
    - make
    - bash profiling/profile.sh
  artifacts:
    paths:
    - gprof-send.txt
    - gprof-recv.txt
    expire_in: 30 days