.gitlab-ci.yml 1.73 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 36 37 38 39 40
    stage: build
    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

41
test:prrt_mem:
42
  stage: test
43 44
  dependencies:
    - build:prrt
45 46
  tags:
    - valgrind
47
  script:
Andreas Schmidt's avatar
Andreas Schmidt committed
48
    - bash memtest.sh
49

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

57 58 59 60 61 62
test:prrt_python_bindings:
  stage: test
  script:
    - sh build.sh

deploy:pypi:
63
  stage: deploy
Andreas Schmidt's avatar
Andreas Schmidt committed
64 65
  tags:
    - python3
Andreas Schmidt's avatar
Andreas Schmidt committed
66
  script:
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

77
clean:pypirc:
78 79 80 81
  stage: clean
  when: always
  script:
    - rm -vf ~/.pypirc