.gitlab-ci.yml 2.62 KB
Newer Older
1 2 3
variables:
  PYPI_USER: SECURE
  PYPI_PASSWORD: SECURE
4
  GIT_SUBMODULE_STRATEGY: recursive
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++
Andreas Schmidt's avatar
Andreas Schmidt committed
25 26
    - pip3 list --format=legacy | grep Cython
    - pip3 list --format=legacy | grep numpy
Andreas Schmidt's avatar
Andreas Schmidt committed
27
    - CC=gcc-5 CXX=g++-5 cmake .
28 29
    - make

30
build:container:
31 32 33 34 35
    stage: build
    tags:
        - docker
    script:
        - export DOCKER_TAG=$(echo "$CI_BUILD_REF_NAME" | sed 's#/#_#' | sed 's#^master$#latest#')
36
        - docker build -t $CI_REGISTRY_IMAGE:$DOCKER_TAG --build-arg http_proxy=http://www-proxy.uni-saarland.de:3128 -f docker/Dockerfile .
37 38 39 40
        - 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

41 42 43 44 45 46 47 48 49 50 51
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

52
test:prrt_mem:
53
  stage: test
54 55
  dependencies:
    - build:prrt
56 57
  tags:
    - valgrind
58
  script:
59
    - bash tests/memtest.sh
60

61
test:prrt_functional:
62
  stage: test
63 64
  dependencies:
    - build:prrt
65 66
  tags:
    - bash
67
  script:
68
    - rm CMakeCache.txt
Andreas Schmidt's avatar
Andreas Schmidt committed
69 70
    - CC=gcc-5 CXX=g++-5 cmake . -DPRRT_TESTS=1
    - make
71
    - exec ./prrtTests
72

73 74
test:prrt_python_bindings:
  stage: test
75
  tags:
76
    - bash
77
    - python3
78
  script:
79
    - sh tests/build.sh
80 81

deploy:pypi:
82
  stage: deploy
83 84
  tags:
    - python3
Andreas Schmidt's avatar
Andreas Schmidt committed
85
  script:
86 87 88 89 90 91 92 93 94
    - 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
95
    - rm -vf ~/.pypirc
96 97 98 99 100 101

deploy:profile:
  stage: deploy
  tags:
    - gprof
  script:
102 103
    - ls -lahv
    - rm CMakeCache.txt
104 105 106 107 108 109 110
    - CC=gcc-5 CXX=g++-5 cmake . -DGPROF=1
    - make
    - bash profiling/profile.sh
  artifacts:
    paths:
    - gprof-send.txt
    - gprof-recv.txt
Andreas Schmidt's avatar
Andreas Schmidt committed
111
    expire_in: 30 days