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

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

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

test_prrt_mem:
  stage: test
32 33
  tags:
    - valgrind
34
  script:
35
    - which valgrind
36
    - export prrtResult=0
37 38
    - valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/receiver 5000 127 & export prrtReceiverProcessID=$!
    - valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/sender 127.0.0.1 5000 127 || prrtResult=$?; kill -INT $prrtReceiverProcessID; wait $prrtReceiverProcessID || prrtResult=$?
39 40
    - exit $prrtResult

41 42
test_prrt_functional:
  stage: test
43
  script:
44
    - ./bin/prrtTests
45

46 47 48 49 50 51 52 53 54 55 56
build_container:
    stage: deploy
    tags:
        - docker
    script:
        - export DOCKER_TAG=$(echo "$CI_BUILD_REF_NAME" | 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 .
        - 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

57 58
package_pypi:
  stage: deploy
59 60
  tags:
    - python3
Andreas Schmidt's avatar
Andreas Schmidt committed
61
  script:
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
    - 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

clean_pypirc:
  stage: clean
  when: always
  script:
    - rm -vf ~/.pypirc