-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
85 lines (72 loc) · 2.3 KB
/
.gitlab-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
# -----------------------------------Set Up------------------------------------
variables:
PY_VERSION: 3
PRIVATE: 0
TMPDIR: ./tmp
VENV: pysitk-test-py${PY_VERSION}
ITK_DIR: /mnt/shared/mebner/environment/ITK/ITK_NiftyMIC-python${PY_VERSION}-build
FSL_DIR: /mnt/shared/mebner/environment/FSL/fsl
NIFTYREG_INSTALL: /mnt/shared/mebner/environment/NiftyReg/NiftyReg-master-install
CONVERT3D_INSTALL: /mnt/shared/mebner/environment/Convert3D/c3d-git-install
before_script:
# add NiftyReg to PATH
- export PATH="${NIFTYREG_INSTALL}/bin:$PATH"
# add FSL
- PATH=${FSL_DIR}/bin:${PATH}
- export PATH="${FSL_INSTALL}/bin:$PATH"
- export FSLOUTPUTTYPE=NIFTI_GZ
# add Convert3D to PATH
- export PATH="${CONVERT3D_INSTALL}/bin:$PATH"
# save current folder path
- cwd_dir=$(pwd)
# create virtual environment
- rm -rf ${VENV}
- mypython=$(which python${PY_VERSION})
- virtualenv -p $mypython ${VENV}
- cd ${VENV}
- venv_dir=$(pwd)
- source bin/activate
# print Python version to CI output
- which python
- python --version
# copy ITK_NiftyMIC-build WrapITK to site-packages of python venv
- py_sitepkg=${venv_dir}/lib/python*/site-packages
- cp -v ${ITK_DIR}/Wrapping/Generators/Python/WrapITK.pth ${py_sitepkg}
- cd $cwd_dir
# If cmiclab is used:
# add CI_JOB_TOKEN for cloning dependent repositories in requirements.txt
# (https://docs.gitlab.com/ee/user/project/new_ci_build_permissions_model.html#dependent-repositories)
- >
(if [ ${PRIVATE} == 1 ];
then sed -i -- "s#github.com/gift-surg#gitlab-ci-token:${CI_JOB_TOKEN}@cmiclab.cs.ucl.ac.uk/GIFT-Surg#g" requirements.txt;
fi);
# install requirements
- pip install -r requirements.txt
# run installation
- pip install .
after_script:
# delete tmp-directory
- rm -rfv ${TMPDIR}
# ----------------------------------Test Jobs----------------------------------
builddocs:
# only:
# - master
script:
- cd doc
- doxygen doxyfile
tags:
- gift-adelie
installation:
# only:
# - master
script:
- python -m nose tests/installation_test.py
tags:
- gift-adelie
applications:
# only:
# - master
script:
- python -m nose tests/application_test.py
tags:
- gift-adelie