.gitlab-ci.yml 1.87 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
  script:
32
    - bash .gitlab/get_version_diff.sh
Pierre Paleo's avatar
Pierre Paleo committed
33
34
    - python -m pip install .
    - nabu-test
Pierre Paleo's avatar
Pierre Paleo committed
35
#  allow_failure: true
Pierre Paleo's avatar
Pierre Paleo committed
36

37
38

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


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



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


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