forked from aramis-lab/clinica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
234 lines (217 loc) · 5.72 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
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
# Continous Integration Script
# Clinica - ARAMIS
#
stages:
- build
- install
- short_tests
- long_tests
- package
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
CLINICA_ENV_BRANCH: "clinica_env_$CI_COMMIT_REF_NAME"
WORK_DIR_LINUX: "/mnt/data/ci/working_dir_linux"
WORK_DIR_MAC: "/Volumes/data/working_directory_ci_mac"
cache:
paths:
- .cache/
before_script:
- pwd
- export CLINICA_ENV_BRANCH_CLEAN=$(echo $CLINICA_ENV_BRANCH | tr -dc '[:alnum:]\-\_')
after_script:
# - conda env remove -y --name clinica_env_upgrade_dep
build:mac:
stage: build
tags:
- macOS
script:
# If the environment already exists or if it's changed
# (by editing the environment.yml file), the environment
# is recreated.
- >
if conda env list|grep -w $CLINICA_ENV_BRANCH_CLEAN; then
if git diff HEAD~ --name-only|grep environment.yml; then
echo "REcreate environment $CLINICA_ENV_BRANCH_CLEAN"
conda env create --force --file environment.yml -n $CLINICA_ENV_BRANCH_CLEAN
fi;
else
echo "Create environment $CLINICA_ENV_BRANCH_CLEAN"
conda env create --force --file environment.yml -n $CLINICA_ENV_BRANCH_CLEAN
fi;
build:linux:
stage: build
tags:
- linux
script:
# If the environment already exists or if it's changed
# (by editing the environment.yml file), the environment
# is recreated.
- >
if conda env list|grep -w $CLINICA_ENV_BRANCH_CLEAN; then
if git diff HEAD~ --name-only|grep environment.yml; then
echo "REcreate environment $CLINICA_ENV_BRANCH_CLEAN"
conda env create --force --file environment.yml -n $CLINICA_ENV_BRANCH_CLEAN
fi;
else
echo "Create environment $CLINICA_ENV_BRANCH_CLEAN"
conda env create --force --file environment.yml -n $CLINICA_ENV_BRANCH_CLEAN
fi;
launch:mac:
# Install python dependencies for Clinica
stage: install
tags:
- install
- macOS
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- pip install --ignore-installed .
- eval "$(register-python-argcomplete clinica)"
- clinica --help
- source deactivate
launch:linux:
# Install python dependencies for Clinica
stage: install
tags:
- install
- linux
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- pip install --ignore-installed .
- eval "$(register-python-argcomplete clinica)"
- clinica --help
- source deactivate
test:style:
stage: short_tests
tags:
- linux
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- pytest --verbose -k 'test_coding_style'
test:instantiate:mac:
stage: short_tests
tags:
- macOS
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /Volumes/data/data_ci ./data
- pytest --verbose -k 'test_instantiate'
- module purge
- source deactivate
test:instantiate:linux:
stage: short_tests
tags:
- linux
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /localdrive10TB/data/ci/data_ci_upgrade ./data
- taskset -c 0-21 pytest
--verbose
--working_directory=$WORK_DIR_LINUX
--disable-warnings
--timeout=0
-n 6
-k 'test_instantiate'
- module purge
- source deactivate
test:run:mac:iotools:
stage: long_tests
tags:
- macOS
- long
only:
- schedules
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /Volumes/data/data_ci ./data
- pytest
--verbose
--working_directory=$WORK_DIR_MAC
--disable-warnings
--numprocesses 4
nonregression/test_run_iotools.py
- module purge
- source deactivate
- rm -rf $WORK_DIR_MAC/*
test:run:mac:pipelines:
stage: long_tests
tags:
- macOS
- long
only:
- schedules
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /Volumes/data/data_ci ./data
- pytest
--verbose
--working_directory=$WORK_DIR_MAC
--disable-warnings
--numprocesses 4
nonregression/test_run_pipelines.py
- module purge
- source deactivate
- rm -rf $WORK_DIR_MAC/*
test:run:linux:iotools:
stage: long_tests
tags:
- linux
- long
only:
- schedules
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /localdrive10TB/data/ci/data_ci_upgrade ./data
- pytest
--verbose
--working_directory=$WORK_DIR_LINUX
--disable-warnings
--timeout=0
--numprocesses 4
nonregression/test_run_iotools.py
- module purge
- source deactivate
- rm -rf WORK_DIR_LINUX/*
test:run:linux:pipelines:
stage: long_tests
tags:
- linux
- long
only:
- schedules
script:
- source activate $CLINICA_ENV_BRANCH_CLEAN
- module load clinica.all
- cd test
- ln -s /localdrive10TB/data/ci/data_ci_upgrade ./data
- pytest
--verbose
--working_directory=$WORK_DIR_LINUX
--disable-warnings
--timeout=0
--numprocesses 4
nonregression/test_run_pipelines.py
- module purge
- source deactivate
- rm -rf WORK_DIR_LINUX/*
pkg:
stage: package
tags:
- macOS
script:
- tar -cvzf --exclude='.gitignore' --exclude='.git' --exclude='.DS_Store' --exclude='.gitmodules' --exclude='.idea' --exclude='.vscode' --exclude='.gitlab-ci.yml' -f clinica-$CI_COMMIT_REF_NAME.tar.gz ./*
artifacts:
name: "$CI_COMMIT_REF_NAME"
paths:
- clinica-$CI_COMMIT_REF_NAME.tar.gz
only:
- tags