-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
73 lines (61 loc) · 1.98 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
# -----------------------------------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
before_script:
# 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 -e .
after_script:
# delete tmp-directory
- rm -rfv ${TMPDIR}
# ----------------------------------Test Jobs----------------------------------
builddocs:
# only:
# - master
script:
- cd doc
- doxygen doxyfile
tags:
- gift-adelie
unittests:
# only:
# - master
script:
# Install coverage: Otherwise packages in venv not recognized
- pip install coverage
# erase previously collected coverage data
- coverage erase
# run unit tests and measure coverage
- coverage run -a --source . -m unittest discover -s "tests" -p "*_test.py"
# report coverage stats on modules
- coverage report -m
tags:
- gift-adelie