.gitlab-ci.yml 1.83 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
    - 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
26
    - pip install --upgrade numpy
27
    - pip install silx --upgrade --pre silx
28
29
30
    - pip install scipy
    - if [[ $CI_RUNNER_TAGS == *"gpu"* ]]; then pip install pycuda scikit-cuda; fi

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

36
37

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


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



Pierre Paleo's avatar
Pierre Paleo committed
57
.pages_base:
58
  stage: deploy
Pierre Paleo's avatar
Pierre Paleo committed
59
  before_script:
60
    - source $VENV_DIR/bin/activate
Pierre Paleo's avatar
Pierre Paleo committed
61
    - pip install --upgrade pip
Pierre Paleo's avatar
Pierre Paleo committed
62
    - pip install sphinx cloud_sptheme nbsphinx recommonmark numpy
payno's avatar
payno committed
63
    - rm -rf public
Pierre Paleo's avatar
Pierre Paleo committed
64
  script:
payno's avatar
payno committed
65
    - python setup.py build build_sphinx -b html
payno's avatar
payno committed
66
    - mv build/sphinx/html public
payno's avatar
payno committed
67
68
  after_script:
    - ls -Rl public
69
70


71
pages:
Pierre Paleo's avatar
Pierre Paleo committed
72
  extends: .pages_base
73
74
75
76
77
  variables:
    LOCAL_REPO: $LOCAL_REPO_SHELL
    VENV_DIR: $VENV_DIR_SHELL
  tags:
    - shell
78
79
80
  artifacts:
    paths:
    - public
payno's avatar
payno committed
81
    expire_in: 2h
82
83
  only:
    - master