.gitlab-ci.yml 1.76 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 25 26
    - which cmake
    - which gcc
    - which g++
    - pip3 list | grep Cython
    - pip3 list | grep numpy
27
    - CC=gcc-5 CXX=g++-5 cmake . -DPRRT_TESTS=1
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
test:prrt_mem:
42
  stage: test
43 44
  dependencies:
    - build:prrt
45 46
  tags:
    - valgrind
47
  script:
48
    - bash tests/memtest.sh
49

50
test:prrt_functional:
51
  stage: test
52 53
  dependencies:
    - build:prrt
54 55
  tags:
    - bash
56
  script:
57
    - exec ./bin/prrtTests
58

59 60
test:prrt_python_bindings:
  stage: test
61
  tags:
62
    - bash
63
    - python3
64
  script:
65
    - sh tests/build.sh
66 67

deploy:pypi:
68
  stage: deploy
Andreas Schmidt's avatar
Andreas Schmidt committed
69 70
  tags:
    - python3
Andreas Schmidt's avatar
Andreas Schmidt committed
71
  script:
72 73 74 75 76 77 78 79 80
    - 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
81
    - rm -vf ~/.pypirc