.gitlab-ci.yml 1.73 KB
Newer Older
Pierre Paleo's avatar
Pierre Paleo committed
1
stages:
Pierre Paleo's avatar
Pierre Paleo committed
2
  - test
Pierre Paleo's avatar
Pierre Paleo committed
3
4
5
  - deploy


6
7
8
9
10
11
12
variables:
  PROJECT_NAME: "nabu"
  LOCAL_REPO_SHELL: "/dev/shm/gitlab_ci/nabu"
  VENV_DIR_SHELL: /dev/shm/gitlab_ci/nabu/venv
  LOCAL_REPO_DOCKER: "/root/gitlab_ci/nabu"
  VENV_DIR_DOCKER: "/root/gitlab_ci/nabu/venv"
  USE_CLEAN_VENV: "false"
Pierre Paleo's avatar
Pierre Paleo committed
13

Pierre Paleo's avatar
Pierre Paleo committed
14

Pierre Paleo's avatar
Pierre Paleo committed
15
.linux_base:
Pierre Paleo's avatar
Pierre Paleo committed
16
17
  stage: test
  before_script:
Pierre Paleo's avatar
Pierre Paleo committed
18
19
    - unset HTTP_PROXY
    - unset HTTPS_PROXY
20
21
22
23
24
25
26
27
28
29
    - if [ ! -d $LOCAL_REPO ]; then mkdir -p $LOCAL_REPO; fi
    - if [ -d $VENV_DIR ]; then if [ "$USE_CLEAN_VENV" == "true" ]; then rm -rf $VENV_DIR; fi; fi
    - python3 -m venv $VENV_DIR
    - source $VENV_DIR/bin/activate
    - echo "Running $(python --version) from $(which python) on $(hostname) ($(arch))"
    - pip install --upgrade pip setuptools wheel
    - pip install --upgrade numpy silx
    - pip install scipy
    - if [[ $CI_RUNNER_TAGS == *"gpu"* ]]; then pip install pycuda scikit-cuda; fi

Pierre Paleo's avatar
Pierre Paleo committed
30
31
32
  script:
    - python -m pip install .
    - nabu-test
Pierre Paleo's avatar
Pierre Paleo committed
33
#  allow_failure: true
Pierre Paleo's avatar
Pierre Paleo committed
34

35
36

linux_shell:
Pierre Paleo's avatar
Pierre Paleo committed
37
  extends: .linux_base
38
39
40
41
42
43
44
45
  variables:
    LOCAL_REPO: $LOCAL_REPO_SHELL
    VENV_DIR: ${VENV_DIR_SHELL}
  tags:
    - shell


linux_docker:
Pierre Paleo's avatar
Pierre Paleo committed
46
  extends: .linux_base
Pierre Paleo's avatar
Pierre Paleo committed
47
  image: docker-registry.esrf.fr/dau/tomwer:python3.5_stretch_pyqt5
48
49
50
51
52
53
54
55
  variables:
    LOCAL_REPO: $LOCAL_REPO_DOCKER
    VENV_DIR: $VENV_DIR_DOCKER
  tags:
    - docker



Pierre Paleo's avatar
Pierre Paleo committed
56
.pages_base:
57
  stage: deploy
Pierre Paleo's avatar
Pierre Paleo committed
58
  before_script:
59
    - source $VENV_DIR/bin/activate
Pierre Paleo's avatar
Pierre Paleo committed
60
    - pip install --upgrade pip
Pierre Paleo's avatar
Pierre Paleo committed
61
    - pip install sphinx cloud_sptheme nbsphinx recommonmark numpy
Pierre Paleo's avatar
Pierre Paleo committed
62
  script:
Pierre Paleo's avatar
Pierre Paleo committed
63
64
    - cd doc
    - make html
Pierre Paleo's avatar
Pierre Paleo committed
65
66
67
    - cd ..
    - mkdir public
    - cp -rv doc/_build/html/* public/
Pierre Paleo's avatar
Pierre Paleo committed
68
69
  artifacts:
    paths:
Pierre Paleo's avatar
Pierre Paleo committed
70
      - public
71
72
73


pages_shell:
Pierre Paleo's avatar
Pierre Paleo committed
74
  extends: .pages_base
75
76
77
78
79
80
81
  variables:
    LOCAL_REPO: $LOCAL_REPO_SHELL
    VENV_DIR: $VENV_DIR_SHELL
  tags:
    - shell