.gitlab-ci.yml 6.31 KB
Newer Older
payno's avatar
payno committed
1
stages:
payno's avatar
payno committed
2
  - style
payno's avatar
payno committed
3
  - build
payno's avatar
payno committed
4
  - test
payno's avatar
payno committed
5
  - deploy
payno's avatar
payno committed
6

payno's avatar
payno committed
7

payno's avatar
payno committed
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


payno's avatar
payno committed
14
15
16
17
18
# style
check_style:
  stage: style
  image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
  before_script:
Henri Payno's avatar
Henri Payno committed
19
    - pip install flake8
payno's avatar
payno committed
20
    - pip install black
payno's avatar
payno committed
21
  script:
Henri Payno's avatar
Henri Payno committed
22
23
    - flake8 est
    - flake8 orangecontrib
payno's avatar
payno committed
24
    - LC_ALL=C.UTF-8 black --check --safe .
payno's avatar
payno committed
25
26


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

# test
58
59
60
61
62
63
64
.build_template: &test_linux_template_pymca
  stage: test
  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}
payno's avatar
payno committed
65
    - export EST_TEST_PROCESS=False
66
67
68
69
    - python --version
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install numpy --upgrade
70
    - python -m pip install pytest-cov
71
72
73
74
75
    - python -m pip install matplotlib
  script:
    - source ./ci/install_scripts.sh
    - install_anyqt 'master'
    - python -m pip install fabio --upgrade --pre
76
    - python -m pip install silx --upgrade --pre
77
    - python -m pip install pymca --upgrade --pre
78
    - python -m pip install .
79
    - /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python -m pytest est
80
81
82
83
84
85
86
87
88


.build_template: &test_linux_template_larch
  stage: test
  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}
89
    - export LD_LIBRARY_PATH='${LD_LIBRARY_PATH}:/usr/local/lib'
payno's avatar
payno committed
90
    - export EST_TEST_PROCESS=False
91
92
93
94
95
    - python --version
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install numpy --upgrade
    - python -m pip install matplotlib
96
    - python -m pip install pytest-cov
97
98
99
100
  script:
    - source ./ci/install_scripts.sh
    - install_anyqt 'master'
    - python -m pip install fabio --upgrade --pre
101
    - python -m pip install silx --upgrade --pre
payno's avatar
fix CI    
payno committed
102
    - python -m pip install packaging
103
    - python -m pip install xraylarch
104
    - python -m pip install .
105
    - /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python -m pytest est
106
107
108


.build_template: &test_linux_template_pymca_larch
payno's avatar
payno committed
109
110
111
112
113
114
  stage: test
  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}
115
    - export LD_LIBRARY_PATH='${LD_LIBRARY_PATH}:/usr/local/lib'
payno's avatar
payno committed
116
    - export EST_TEST_PROCESS=False
payno's avatar
payno committed
117
118
119
120
121
    - python --version
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install numpy --upgrade
    - python -m pip install matplotlib
122
    - python -m pip install pytest-cov
payno's avatar
payno committed
123
124
125
126
  script:
    - source ./ci/install_scripts.sh
    - install_anyqt 'master'
    - python -m pip install fabio --upgrade --pre
127
    - python -m pip install silx --upgrade --pre
128
    - python -m pip install pymca --upgrade --pre
payno's avatar
fix CI    
payno committed
129
130
    - python -m pip install packaging
    - python -m pip install xraylarch
131
    - python -m pip install .
132
    - /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a python -m pytest --cov=est est
payno's avatar
payno committed
133
134


payno's avatar
fix CI    
payno committed
135
136
test:python3.7-stretch-pyqt5_pymca:
  image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
137
138
139
  <<: *test_linux_template_pymca


payno's avatar
fix CI    
payno committed
140
test:python3.7-stretch-pyqt5_larch:
141
  image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
142
  <<: *test_linux_template_larch
143
144


payno's avatar
fix CI    
payno committed
145
test:python3.7-stretch-pyqt5_pymca_larch:
146
  image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
147
  <<: *test_linux_template_pymca_larch
148

Henri Payno's avatar
Henri Payno committed
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
check_lint:
  stage: test
  image: docker-registry.esrf.fr/dau/ewoks:python_3.8
  tags:
    - linux
  before_script:
    - arch
    - which python
    - python --version
    - python -m pip install pip --upgrade
    - python -m pip install setuptools --upgrade
    - python -m pip install flake8
  script:
    - python setup.py build
    - python -m pip install .[doc]
    - python setup.py build_sphinx
    - mv build/sphinx/html artifacts/doc
  artifacts:
    paths:
      - artifacts/doc/
    when: on_success
    expire_in: 2h
  only:
    - master
173

payno's avatar
payno committed
174
test:test-est-tutorials_pymca:
175
  image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
176
177
178
179
180
181
182
183
184
185
186
187
188
189
  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
    - 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
    - python -m pip install ipykernel
190
    - python -m pip install pymca --upgrade --pre
191
    - python -m pip install silx --upgrade --pre
192
    - python -m pip install .
193
    - ls doc/tutorials/
194
  script:
payno's avatar
payno committed
195
    - /usr/bin/xvfb-run --server-args="-screen 0 1024x768x24" -a jupyter nbconvert --to notebook --execute doc/tutorials/pymca_xas_process.ipynb
payno's avatar
payno committed
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215


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