.gitlab-ci.yml 3.5 KB
Newer Older
payno's avatar
payno committed
1
stages:
payno's avatar
payno committed
2
  - style
3
  - build
payno's avatar
payno committed
4
5
  - test_library
  - test_notbooks
6
  - deploy
payno's avatar
payno committed
7
8
9
10
11
12
13

variables:
  http_proxy: http://proxy.esrf.fr:3128
  https_proxy: http://proxy.esrf.fr:3128
  no_proxy: .esrf.fr,localhost
  ORANGE_WEB_LOG: 'False'

payno's avatar
payno committed
14
15
16
17
18
19
20
21
22
23
24
25

# style
check_style:
  stage: style
  image: docker-registry.esrf.fr/dau/tomwer:python3.8_buster_pyqt5_sphinx
  before_script:
    - pip install black
  script:
    # run black
    - LC_ALL=C.UTF-8 black --check --safe .


26
27
28
# build
doc:
  stage: build
payno's avatar
payno committed
29
  image: docker-registry.esrf.fr/dau/tomwer:python3.8_buster_pyqt5_sphinx
30
31
32
33
34
35
  tags:
    - linux
  before_script:
    - arch
    - which python
    - python --version
payno's avatar
payno committed
36
    - source ./ci/install_scripts.sh
37
38
39
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install sphinx
payno's avatar
payno committed
40
    - python -m pip install nbsphinx
payno's avatar
payno committed
41
    - python -m pip install nbconvert
payno's avatar
payno committed
42
    - python -m pip install pandoc
payno's avatar
payno committed
43
    - install_silx
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    - python -m pip install -r requirements.txt
    - rm -rf artifacts
    - mkdir artifacts
  script:
    - python setup.py build
    - python setup.py build_sphinx
    - mv build/sphinx/html artifacts/doc
  artifacts:
    paths:
      - artifacts/doc/
    when: on_success
    expire_in: 2h
  only:
    - master

payno's avatar
payno committed
59

60
# test_library
payno's avatar
payno committed
61
62
63
64
65
66
67
68
69
.build_template: &test_linux_template
  stage: test_library
  before_script:
    - arch
    - export PYTHONPATH="${PYTHONPATH}:/usr/lib/python3/dist-packages/"
    - export LD_LIBRARY_PATH=/lib/i386-linux-gnu/:${LD_LIBRARY_PATH}
    - export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}
    - export ORANGE_WEB_LOG='False'
    - python --version
payno's avatar
payno committed
70
    - source ./ci/install_scripts.sh
payno's avatar
payno committed
71
72
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
payno's avatar
payno committed
73
    - install_silx
payno's avatar
payno committed
74
    - python -m pip install -r requirements.txt
payno's avatar
payno committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    - python -m pip install .
  script:
    - python -m unittest tomoscan.test.suite -v


test:python3.5-stretch-pyqt5:
  image: docker-registry.esrf.fr/dau/tomwer:python3.5_stretch_pyqt5
  <<: *test_linux_template


test:python3.7_stretch_pyqt5:
  image: docker-registry.esrf.fr/dau/tomwer:python3.7_stretch_pyqt5
  <<: *test_linux_template


90
# test_notbooks
payno's avatar
payno committed
91
92
93
94
95
96
97
98
99
100
test:test-tomoscan-tutorials:
  stage: test_notbooks
  image: docker-registry.esrf.fr/dau/tomwer:python3.7_buster_pyqt5
  before_script:
    - arch
    - export PYTHONPATH="${PYTHONPATH}:/usr/lib/python3/dist-packages/"
    - export LD_LIBRARY_PATH=/lib/i386-linux-gnu/:${LD_LIBRARY_PATH}
    - export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}
    - export ORANGE_WEB_LOG='False'
    - python --version
payno's avatar
payno committed
101
    - source ./ci/install_scripts.sh
payno's avatar
payno committed
102
103
104
105
106
107
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install numpy --upgrade
    - python -m pip install matplotlib
    - python -m pip install jupyter_client
    - python -m pip install nbconvert
payno's avatar
payno committed
108
    - python -m pip install pandoc
payno's avatar
payno committed
109
    - python -m pip install ipykernel
payno's avatar
payno committed
110
    - install_silx
payno's avatar
payno committed
111
    - python -m pip install -r requirements.txt
payno's avatar
payno committed
112
113
114
115
    - python -m pip install fabio --upgrade --pre
    - python -m pip install silx --upgrade --pre
    - python -m pip install .
  script:
payno's avatar
payno committed
116
117
    - jupyter nbconvert --to notebook --execute doc/tutorials/edf_scan.ipynb
    - jupyter nbconvert --to notebook --execute doc/tutorials/hdf5_scan.ipynb
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137


# deploy
pages:
  stage: deploy
  tags:
    - linux
  image: python:3.7-buster
  script:
    - rm -rf public
    # doc
    - mv artifacts/doc public
  after_script:
    - ls -Rl public
  artifacts:
    paths:
      - public
    expire_in: 1h
  only:
    - master