forked from CoSMoMVPA/CoSMoMVPA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
303 lines (264 loc) · 12.1 KB
/
.travis.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
# vim ft=yaml
# travis-ci.org definition for CoSMoMVPA build (based on PyMVPA, which is
# based on nipype configuration, which in turn was based on nipy)
#
# We pretend to be java because we need GNU Octave which is not
# available (as of June 2019)
language: java
dist: xenial
cache:
- apt
env:
global:
- COVERALLS_PARALLEL=true
matrix:
- TRAVIS_WITH_EXTERNALS=false TRAVIS_WITH_COVERAGE=false COVERALLS_PARALLEL=false
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=false COVERALLS_PARALLEL=false
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=1 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=2 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=3 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=4 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=5 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=6 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=7 PARTITION_COUNT=8 COVERALLS_PARALLEL=false NO_DOC_TEST=true
- TRAVIS_WITH_EXTERNALS=true TRAVIS_WITH_COVERAGE=true PARTITION_INDEX=8 PARTITION_COUNT=8 TRAVIS_AFTER_ALL_ARGS='--is_master' COVERALLS_PARALLEL=true NO_DOC_TEST=true
before_install:
# to prevent IPv6 being used for APT
- sudo bash -c "echo 'Acquire::ForceIPv4 \"true\";' > /etc/apt/apt.conf.d/99force-ipv4"
# ensure up-to-date prior to software-properties-common
- travis_retry sudo apt-get -y -qq update
# get Octave 4.0
- travis_retry sudo apt-get install -y -qq software-properties-common python-software-properties libtool autoconf automake m4
- travis_retry sudo apt-add-repository -y ppa:octave/stable
- travis_retry sudo apt-get -y -qq update
- travis_retry sudo apt-get -y install octave
- travis_retry sudo apt-get -y install liboctave-dev
- travis_retry sudo apt-get -y -qq install octave
- octave --version
- which make
# when installing externals, get recent GCC for Octave parallel toolbox
- if [[ "${TRAVIS_WITH_EXTERNALS}" == "trueDISABLED" ]]; then
travis_retry sudo add-apt-repository 'ppa:ubuntu-toolchain-r/test' -y;
travis_retry sudo apt-get update -y -q;
travis_retry sudo apt-get install gcc-4.8 g++-4.8 -y -q;
travis_retry sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20;
travis_retry sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20;
travis_retry sudo update-alternatives --config gcc;
travis_retry sudo update-alternatives --config g++;
travis_retry sudo apt-get install gcc-multilib;
travis_retry sudo apt-get install libgomp1;
c++ --version;
g++ --version;
NAME=automake;
VERSION=1.6;
FULL=${NAME}-${VERSION};
wget https://ftp.gnu.org/gnu/${NAME}/${FULL}.tar.gz;
tar -xzf ${FULL}.tar.gz;
cd ${FULL};
./configure && make && sudo make install;
cd ..;
NAME=autoconf;
VERSION=2.69;
FULL=${NAME}-${VERSION};
wget https://ftp.gnu.org/gnu/${NAME}/${FULL}.tar.gz;
tar -xzf ${FULL}.tar.gz;
cd ${FULL};
./configure && make && sudo make install;
cd ..;
fi
# go up one level
- cd ..
# retrieve MOxUnit
- rm -rf MOxUnit
- travis_retry git clone -v git://github.com/MOxUnit/MOxUnit.git
- make -C MOxUnit install
# retrieve MOdox
- rm -rf MOdox
- travis_retry git clone -v git://github.com/MOdox/MOdox.git
- make -C MOdox install
# optionally retrieve MOcov
- if [[ "$TRAVIS_WITH_COVERAGE" == "true" ]]; then
rm -rf MOcov;
git clone git://github.com/MOcov/MOcov.git;
make -C MOcov install;
fi
# Show package info
- autoconf --version
- automake --version
- m4 --version
install:
- PTH=`pwd`
- OCTAVERC=~/.octaverc
- OCTAVEPTH=`pwd`/CoSMoMVPA/mvpa
- CHECKEXTCMD=""
- OCTAVE_DISABLE_WARNINGS=" Octave:array-to-scalar
Octave:imag-to-real
Octave:language-extension
Octave:missing-semicolon
Octave:resize-on-range-error
Octave:separator-insert
Octave:single-quote-string
Octave:str-to-num
Octave:mixed-string-concat
Octave:variable-switch-label"
- OCTAVE=octave
# TODO: add gifti back
- if [[ "$TRAVIS_WITH_EXTERNALS" == "true" ]]; then
EXTERNALS="
afni
surfing
fieldtrip
libsvm
octave_pkg_struct
octave_pkg_parallel
octave_pkg_statistics
octave_pkg_miscellaneous
";
fi
# ensure Octave rc file exists
- echo "" >> $OCTAVERC;
# use travis-retry
- RETRY=travis_retry
# load Octave io package
- $RETRY $OCTAVE --eval "pkg('install','-auto','-forge','io');";
# optionally enable Octave struct package
- if [[ " $EXTERNALS " = *" octave_pkg_struct "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','struct');";
fi
# optionally enable Octave statistics package
#$RETRY sudo apt-get -y -qq install octave-statistics;
- if [[ " $EXTERNALS " = *" octave_pkg_statistics "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-forge','statistics');";
fi
# optionally enable Octave miscellaneous package
# (the "general" package is required for the "miscellaneous" package)
# (the "miscellaneous" package also requires "units")
- if [[ " $EXTERNALS " = *" octave_pkg_miscellaneous "* ]]; then
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','general');";
$RETRY sudo apt-get -y -qq install units;
$RETRY $OCTAVE --eval "pkg('install','-auto','-forge','miscellaneous');";
fi
# As of Aug 2017, the parallel package is disabled because it made Octave crash
# when using travis
#
# For example see https://travis-ci.org/CoSMoMVPA/CoSMoMVPA/jobs/264122792
#
# Relevant command & travis output
#
# if [[ " $EXTERNALS " = *" octave_pkg_parallel "* ]]; then $RETRY $OCTAVE --eval "pkg('install','-auto','-forge','parallel');"; fi
# octave: X11 DISPLAY environment variable not set
# octave: disabling GUI features
# warning: pkg: autoload is no longer supported. Add a 'pkg load ...' command to octaverc instead.
# warning: called from
# pkg at line 316 column 9
# warning: doc_cache_create: unusable help text found in file 'parallel_interface'
# For information about changes from previous versions of the parallel package, run 'news parallel'.
# *** Error in `/usr/bin/octave-cli': double free or corruption (fasttop): 0x0000000001669e00 ***
# panic: Aborted -- stopping myself...
# attempting to save variables to 'octave-workspace'...
# panic: attempted clean up failed -- aborting...
# /home/travis/.travis/job_stages: line 229: 15780 Aborted (core dumped) "$@"
# The command "octave --eval pkg('install','-auto','-forge','parallel');" failed. Retrying, 2 of 3.
#
## - if [[ " $EXTERNALS " = *" octave_pkg_parallel "* ]]; then
## $RETRY $OCTAVE --eval "pkg('install','-auto','-forge','parallel');";
## fi
# optionally install surfing toolbox
- if [[ " $EXTERNALS " = *" surfing "* ]]; then
rm -rf surfing;
git clone git://github.com/nno/surfing.git --depth 1;
make -C surfing install;
fi
# optionally install afni
- if [[ " $EXTERNALS " = *" afni "* ]]; then
rm -rf afni;
git clone git://github.com/afni/afni.git --depth 1;
$OCTAVE --eval "addpath('${PTH}/afni/src/matlab');savepath();";
fi
# optionally install FieldTrip, using one of the branches below
# If FieldTrip temporarily breaks the build, we can switch to another
# custum branch that fixes the issue. The official branch is the
# last entry in the list below.
#
# 2019-07-19: https://github.com/fieldtrip/fieldtrip/pull/1171
# git clone git://github.com/nno/fieldtrip.git --depth 1 -b _octave/fix_compat;
# git clone git://github.com/fieldtrip/fieldtrip.git --depth 1;
- if [[ " $EXTERNALS " = *" fieldtrip "* ]]; then
rm -rf fieldtrip;
git clone git://github.com/nno/fieldtrip.git --depth 1 -b _octave/fix_compat;
$OCTAVE --eval "cd('${PTH}/fieldtrip');
ft_defaults();
rmpath('${PTH}/fieldtrip/external/gifti');
savepath();";
fi
# optionally install libsvm
- if [[ " $EXTERNALS " = *" libsvm "* ]]; then
rm -rf libsvm;
git clone git://github.com/cjlin1/libsvm.git;
$OCTAVE --eval "cd('${PTH}/libsvm/matlab');
make;
addpath(pwd);
savepath();";
fi
# optionally install gifti library
# Note: FieldTrip brings its own version, which we remove from the path
- if [[ " $EXTERNALS " = *" gifti "* ]]; then
git clone https://github.com/gllmflndn/gifti.git;
$OCTAVE --eval "cd('gifti/@gifti/private');
mex('zstream.c');
addpath('${PTH}/gifti');
rmpath('${PTH}/fieldtrip/external/gifti');
savepath();";
ls ${PTH}/gifti/@gifti/private;
fi
# disable "more"
- echo "more('off');" >> $OCTAVERC
# prevent shippable from re-using old test results
- if [[ "$SHIPPABLE" == "true" ]]; then
rm -f shippable/testresults/*.xml;
fi
before_script:
# (note: Shippable.com does not work properly if the
# Octave pacakges are installed in the "install" section)
# Shippable.com seems to puke on travis_retry with quoted arguments,
# so only use travis_retry on travis
- if [[ "$SHIPPABLE" != "true" ]] && [[ "$TRAVIS" == "true" ]]; then
RETRY=travis_retry;
fi
# show Octave-rc
- echo "Octave-rc:"; cat $OCTAVERC
# show which packages are installed
- $OCTAVE --eval "pkg('list')"
# show WTF
- $OCTAVE --eval "addpath('${PTH}/CoSMoMVPA/mvpa');cosmo_wtf()"
script:
- cd CoSMoMVPA
- ls
- if [[ "$TRAVIS_WITH_COVERAGE" == "true" ]]; then
TEST_ARGS=WITH_COVERAGE=true;
COVER_ARGS=COVER=`pwd`/mvpa;
if [[ "$SHIPPABLE" == "true" ]]; then
OUTPUT_ARGS=COVER_XML_FILE=shippable/codecoverage/coverage.xml;
elif [[ "$TRAVIS" == "true" ]]; then
OUTPUT_ARGS=COVER_JSON_FILE=`pwd`/coveralls.json;
AFTER_SCRIPT="curl --verbose -F json_file=@`pwd`/coveralls.json https://coveralls.io/api/v1/jobs";
if [ ! -z "$PARTITION_INDEX" ]; then
PARTITION_ARGS="TEST_PARTITION_INDEX=${PARTITION_INDEX} TEST_PARTITION_COUNT=${PARTITION_COUNT}";
fi
fi;
elif [[ "$SHIPPABLE" == "true" ]]; then
RESULT_ARGS=JUNIT_XML_FILE=shippable/testresults/test_results.xml;
fi
- make test $TEST_ARGS $COVER_ARGS $OUTPUT_ARGS $RESULT_ARGS $PARTITION_ARGS
after_script:
- echo "After script"
- tools/travis_after_all.py $TRAVIS_AFTER_ALL_ARGS
- cat .to_export_back
- export $(cat .to_export_back)
- if [[ "$TRAVIS_WITH_COVERAGE" == "true" ]]; then
if [[ "$TRAVIS" == "true" ]]; then
echo "Sending json";
cat `pwd`/coveralls.json;
fi;
fi
- $AFTER_SCRIPT