-
Notifications
You must be signed in to change notification settings - Fork 5
455 lines (376 loc) · 14.4 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
name: CI/CD
on: [push, workflow_dispatch]
jobs:
ci_ubuntu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04']
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.9.13'
- name: Install dependencies
run: |
python3 -m pip install numpy matplotlib Cython netCDF4 pyyaml h5py vtk
- name: Install MDANSE
run: |
cd $GITHUB_WORKSPACE
python3 setup.py install
- name: Run tests
if: false
run: |
export PATH=$PATH:/usr/lib/x86_64-linux-gnu
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/definitions.sh
$GITHUB_WORKSPACE/BuildServer/Unix/tests.sh
deploy_ubuntu:
needs: ci_ubuntu
runs-on: ${{ matrix.os }}
env:
PYTHON_MINOR_VER: 9
PYTHON_VER: 3.9.13
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04']
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VER }}
- name: Install netcdf
run: |
sudo apt-get update
sudo apt-get install dos2unix graphviz libgtk-3-dev
- name: Install packages with pip
run: |
python3 -m pip install numpy matplotlib Cython netCDF4 pyyaml h5py vtk attrdict3 sphinx distro psutil
- name: Install wxpython with conda
run: |
sudo conda create -p ~/tempenv -c conda-forge python=$PYTHON_VER wxpython
sudo cp -rfv ~/tempenv/lib/python3.$PYTHON_MINOR_VER/site-packages/wx $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib/python3.9/site-packages
sudo cp -rfv ~/tempenv/lib/python3.$PYTHON_MINOR_VER/site-packages/wxPython* $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib/python3.9/site-packages
sudo cp -rfv ~/tempenv/lib/wx $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib
sudo cp -rfv ~/tempenv/include/wx-3.1 $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/include
sudo cp -v ~/tempenv/lib/libwx* $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib
sudo cp -v ~/tempenv/lib/libiconv* $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib/python3.$PYTHON_MINOR_VER/site-packages/wx
sudo cp -v ~/tempenv/lib/libjpeg* $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib/python3.$PYTHON_MINOR_VER/site-packages/wx
- name: Deploy
run: |
sudo ~/python/bin/python -m pip install sphinx==1.6.7 stdeb docutils==0.17.1 graphviz
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/definitions.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/setup_ci.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/deploy.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_installer
path: ${{ github.workspace }}/*.deb
retention-days: 90
- name: Edit postinst
if: ${{ (matrix.os == 'ubuntu-20.04') }}
run: |
sed -i '$ a ln -s /usr/lib/x86_64-linux-gnu/libnetcdf.so.18 /usr/local/lib/libnetcdf.so.15' $GITHUB_WORKSPACE/BuildServer/Unix/Debian/Resources/DEBIAN/postinst
sed -i '$ a rm /usr/local/lib/libnetcdf.so.15' $GITHUB_WORKSPACE/BuildServer/Unix/Debian/Resources/DEBIAN/postrm
- name: Deploy for ubuntu 21
if: ${{ (matrix.os == 'ubuntu-20.04') }}
run: |
sudo cp -fv /usr/lib/x86_64-linux-gnu/libffi* $RUNNER_TOOL_CACHE/Python/$PYTHON_VER/x64/lib/python3.$PYTHON_MINOR_VER/site-packages/wx
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/definitions.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/setup_ci.sh
export DISTRO=ubuntu-21.04
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/deploy.sh
- name: Upload ubuntu21 artifacts
if: ${{ (matrix.os == 'ubuntu-20.04') }}
uses: actions/upload-artifact@v2
with:
name: ubuntu-21.04_installer
path: ${{ github.workspace }}/*21*.deb
retention-days: 90
ci_ubuntu22:
runs-on: 'ubuntu-22.04'
strategy:
fail-fast: false
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Install libraries
run: |
sudo apt-get update
sudo apt-get install netcdf-bin libnetcdf-dev libgtk2.0-0 libgtk2.0-dev
- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 2.7.18
activate-environment: mdanse
- name: Install python netCDF4 package
run: conda install netCDF4 -n mdanse
- name: Install python packages
run: |
$CONDA/envs/mdanse/bin/python -m pip install numpy matplotlib Cython Pyro stdeb pyyaml h5py psutil
- name: Install ScientificPython
run: |
cd $HOME
git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python/
sudo $CONDA/envs/mdanse/bin/python setup.py install
- name: Install MMTK
run: |
cd $HOME
git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk
sudo cp -fv $GITHUB_WORKSPACE/BuildServer/Unix/setup.py ~/mmtk
sudo $CONDA/envs/mdanse/bin/python setup.py install
- name: Install MDANSE
run: |
cd $GITHUB_WORKSPACE
$CONDA/envs/mdanse/bin/python setup.py install
- name: Run unit tests
run: |
cd $GITHUB_WORKSPACE/Tests/UnitTests
$CONDA/envs/mdanse/bin/python AllTests.py
- name: Run dependency tests
run: |
cd $GITHUB_WORKSPACE/Tests/DependenciesTests
$CONDA/envs/mdanse/bin/python AllTests.py
- name: Run functional tests
run: |
cd $GITHUB_WORKSPACE/Tests/FunctionalTests/Jobs
$CONDA/envs/mdanse/bin/python BuildJobTests.py
$CONDA/envs/mdanse/bin/python AllTests.py
- name: Tar python
if: |
contains( github.ref, 'legacy' )
run: |
cd $CONDA/envs
tar -czf python.tar.gz mdanse
- name: Upload artifacts
if: |
contains( github.ref, 'legacy' )
uses: actions/upload-artifact@v2
with:
name: ubuntu-22.04_artifacts
path: /usr/share/miniconda/envs/python.tar.gz
retention-days: 1
deploy_ubuntu22:
needs: ci_ubuntu22
runs-on: 'ubuntu-22.04'
strategy:
fail-fast: false
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Initialise conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 2.7.18
activate-environment: mdanse
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ubuntu-22.04_artifacts
path: /usr/share/miniconda/envs
- name: Untar python
run: |
cd $CONDA/envs
tar -xzf python.tar.gz
- name: Install netcdf
run: |
sudo apt-get update
sudo apt-get install netcdf-bin libnetcdf-dev
- name: Install wxPython and VTK python packages
run: |
sudo conda install -n mdanse -c daf wxpython
sudo conda install -n mdanse -c ccordoba12 vtk
- run: sudo apt-get install dos2unix graphviz
- run: conda remove ncurses --force
- name: Deploy
run: |
sudo $CONDA/envs/mdanse/bin/python -m pip install sphinx==1.6.7 docutils==0.17.1 graphviz
sed -i 's|PYTHONEXE=$HOME/python|PYTHONEXE=$CONDA/envs/mdanse|' $GITHUB_WORKSPACE/BuildServer/Unix/Debian/deploy.sh
sudo rm $CONDA/envs/mdanse/lib/libtinfo*
sudo rm $CONDA/envs/mdanse/lib/libncurses*
sudo rm -v $CONDA/envs/mdanse/lib/libstdc*
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/definitions.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/setup_ci.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/Debian/deploy.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ubuntu-22.04_installer
path: ${{ github.workspace }}/*.deb
retention-days: 90
# OSX
ci_osx:
runs-on: ${{ matrix.os }}
if: |
contains( github.ref, 'legacy' )
strategy:
fail-fast: false
matrix:
os: ['macos-11', 'macos-12']
steps:
- uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.9.13'
- name: Install dependencies with pip
run: |
python3 -m pip install numpy matplotlib Cython pyyaml h5py vtk netCDF4
- name: Install MDANSE
run: |
cd $GITHUB_WORKSPACE
python3 setup.py install
- name: Run unit tests
if: false
run: |
cd $GITHUB_WORKSPACE/Tests/UnitTests
python3 AllTests.py
- name: Run unit tests
run: |
cd $GITHUB_WORKSPACE/Tests/UnitTests
python2 AllTests.py
- name: Run functional tests
if: false
run: |
cd $GITHUB_WORKSPACE/Tests/FunctionalTests/Jobs
python3 BuildJobTests.py
python3 AllTests.py
- name: Tar python
if: ${{ (matrix.os == 'macos-12') && ( contains( github.ref, 'legacy' ) ) }}
run: |
cd $RUNNER_TOOL_CACHE/Python/3.9.13
mv x64 Resources
tar -czf python.tar.gz Resources
- name: Upload artifacts
if: ${{ (matrix.os == 'macos-12') && ( contains( github.ref, 'legacy' ) ) }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_artifacts
path: ${{ runner.tool_cache }}/Python/3.9.13/python.tar.gz
retention-days: 1
deploy_osx:
needs: ci_osx
runs-on: macos-12
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: macos-12_artifacts
path: ~/
- run: brew install graphviz
- name: Untar python
run: |
mkdir -p ~/Contents
tar -xzf ~/python.tar.gz -C $HOME/Contents
- name: Install py2app, wxpython, and sphinx
run: |
sudo install_name_tool -change /Users/runner/hostedtoolcache/Python/3.9.13/x64/lib/libpython3.9.dylib /Users/runner/Contents/Resources/lib/libpython3.9.dylib /Users/runner/Contents/Resources/bin/python3.9
sudo install_name_tool -change /Users/runner/hostedtoolcache/Python/3.9.13/x64/lib/libpython3.9.dylib /Users/runner/Contents/Resources/lib/libpython3.9.dylib /Users/runner/Contents/Resources/bin/python
$HOME/Contents/Resources/bin/python -m pip install py2app==0.26.1 wxpython sphinx psutil distro
- name: Install vtk
run: |
sudo conda install -p $HOME/tempenv -c free vtk
sudo cp -r $HOME/tempenv/lib/python2.7/site-packages/vtk ~/Contents/Resources/lib/python2.7/site-packages
sudo cp $HOME/tempenv/lib/libvtk* ~/Contents/Resources/lib
- name: Deploy MDANSE
run: |
source $GITHUB_WORKSPACE/BuildServer/Unix/MacOS/definitions.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/setup_ci.sh
source $GITHUB_WORKSPACE/BuildServer/Unix/MacOS/deploy.sh
sudo cp -fv $GITHUB_WORKSPACE/BuildServer/Unix/MacOS/Resources/README.txt $GITHUB_WORKSPACE
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: MacOS executable
path: |
${{ github.workspace }}/*.dmg
${{ github.workspace }}/README.txt
retention-days: 90
# WINDOWS
ci_windows:
runs-on: windows-latest
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.9.13'
- name: Install backend dependencies
run: |
python3 -m pip install numpy matplotlib Cython pyyaml h5py netCDF4 vtk
shell: cmd
- name: Install MDANSE
run: |
cd %GITHUB_WORKSPACE%
python3 setup.py install
shell: cmd
- name: Run unit tests
if: false
run: |
cd %GITHUB_WORKSPACE%\Tests\UnitTests\
python3 AllTests.py
shell: cmd
- name: Run functional tests
if: false
run: |
cd %GITHUB_WORKSPACE%\Tests\FunctionalTests\Jobs
python3 BuildJobTests.py
python3 AllTests.py
shell: cmd
deploy_windows:
runs-on: windows-latest
needs: ci_windows
if: |
contains( github.ref, 'legacy' )
steps:
- uses: actions/checkout@v2
- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9.13
activate-environment: mdanse
- name: Install h5py and netCDF4 witch conda
run: |
conda install h5py netCDF4 graphviz
shell: cmd /C CALL {0}
- name: Install other dependencies with pip
run: |
%CONDA%\envs\mdanse\python.exe -m pip install numpy matplotlib Cython pyyaml vtk psutil wxpython sphinx distro
shell: cmd /C CALL {0}
- name: Alter conf_api.py for correct sphinx build
run: |
Set-Location $Env:GITHUB_WORKSPACE\Doc\
(gc conf_api.py) -replace '#graphviz_dot', 'graphviz_dot' | Out-File -encoding UTF8 conf_api.py
- name: Deploy
run: |
mkdir %GITHUB_WORKSPACE%\BuildServer\Windows\Build
cd %GITHUB_WORKSPACE%\BuildServer\Windows\Build\
call "%GITHUB_WORKSPACE%\BuildServer\Windows\definitions.bat"
call "%GITHUB_WORKSPACE%\BuildServer\Windows\setup_ci.bat"
call "%GITHUB_WORKSPACE%\BuildServer\Windows\deploy.bat"
shell: cmd /C CALL {0}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Windows_executable
path: |
${{ github.workspace }}\*.exe
retention-days: 90