-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
129 lines (119 loc) · 5.11 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
sudo: false
dist: trusty
language: python
python:
- "2.7"
- "3.5"
- "3.6"
matrix:
include:
- python: "2.7"
env: JYTHON=true
cache:
directories:
- $HOME/.cache/pip
- $HOME/virtualenv/python$TRAVIS_PYTHON_VERSION/lib/python$TRAVIS_PYTHON_VERSION/site-packages
- $HOME/virtualenv/python$TRAVIS_PYTHON_VERSION/bin
- $HOME/jython_deps
- $HOME/jython
before_install:
- export JYTHON_URL='http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7.1/jython-installer-2.7.1.jar'
- export REQUIRED_JARS="org.eclipse.january_2.3.0.v201909112144.jar"
- export REQUIRED_JARS="ch.qos.logback.core_1.2.3.jar:$REQUIRED_JARS"
- export REQUIRED_JARS="org.apache.commons.math3_3.6.1.jar:$REQUIRED_JARS"
- export REQUIRED_JARS="slf4j.api_1.7.25.jar:$REQUIRED_JARS"
- export REQUIRED_JARS="uk.ac.diamond.jama_1.0.3.jar:$REQUIRED_JARS"
- export REQUIRED_JARS="org.eclipse.dawnsci.analysis.api_1.2.0.v20191029-1012.jar:$REQUIRED_JARS"
- export REQUIRED_JARS="org.eclipse.dawnsci.nexus_1.1.0.v20191025-1230.jar:$REQUIRED_JARS"
- if [ "$JYTHON" == "true" ]; then
jdk_switcher use oraclejdk8;
if [ ! -f "$HOME/jython/.cache" ]; then
wget $JYTHON_URL -O jython_installer.jar;
java -jar jython_installer.jar -s -d $HOME/jython;
$HOME/jython/bin/easy_install nose;
touch $HOME/jython/.cache;
fi;
export OLD_PATH=$PATH;
export PATH=$HOME/jython/bin:$PATH;
if [ ! -f "$HOME/jython_deps/.cache" ]; then
export DAWN_URL='https://alfred.diamond.ac.uk/DawnDiamond/2.16/downloads/builds-release/DawnDiamond-2.16.1.v20191126-1007-linux64.zip';
wget $DAWN_URL -O $HOME/dawn.zip;
unzip -q $HOME/dawn.zip -d $HOME/dawn;
export DAWN=$(readlink -f $HOME/dawn/DawnDiamond-2.16.1.v20191126-1007-linux64);
cp -r $DAWN/plugins/uk.ac.diamond.scisoft.python_1.4.0/scisoftpy $HOME/jython_deps/numpy;
cp -r $DAWN/plugins/uk.ac.diamond.scisoft.python_1.4.0/* $HOME/jython_deps;
cp -r $DAWN/plugins/uk.ac.diamond.scisoft.analysis_1.5.0.v20191118-1501/* $HOME/jython_deps;
cp -r $DAWN/plugins/org.eclipse.dawnsci.analysis.dataset_1.1.0.v20191021-1259/* $HOME/jython_deps;
cp -r $DAWN/plugins/org.dawnsci.boofcv_1.0.0.v20191014-1522/* $HOME/jython_deps;
cp -r $DAWN/plugins/hdf.hdf5lib_1.10.5.v20190918-1220/* $HOME/jython_deps;
cp -r $DAWN/plugins/org.eclipse.dawnsci.hdf5_1.5.0.v20191022-1538/* $HOME/jython_deps;
IFS=":";
for j in $REQUIRED_JARS; do
cp $DAWN/plugins/$j $HOME/jython_deps/;
done;
touch $HOME/jython_deps/.cache;
fi
fi
install:
- env
- pip install -r requirements/test.txt
- pip install mock
- python setup.py bdist_egg
- if [ "$JYTHON" == "true" ]; then
pip install decorator;
python -m pip install coveralls;
export JYTHONPATH=$HOME/jython_deps;
export CLASSPATH="$HOME/jython_deps:$HOME/jython_deps/jars/*";
IFS=":";
for j in $REQUIRED_JARS; do
export CLASSPATH="$CLASSPATH:$HOME/jython_deps/$j";
done;
unset IFS;
echo "CLASSPATH:";
echo "$CLASSPATH";
else
pip install coveralls;
fi
before_script:
- if [ "$JYTHON" == "true" ]; then
export JAVA_MEM=-Xmx1g
export NOSETESTS=$HOME/jython/bin/nosetests;
else
export NOSETESTS=nosetests;
fi
# For Jython, we have to handle the fact that nosetest's coverage module will
# always fail generating its report - it will still produce the "lines covered"
# data, but fail afterwards. We need to capture return code (255) and generate
# our own - we look at the XUnit XML file for non-zero Errors or Failures
script:
- if [ "$JYTHON" == "true" ]; then
$NOSETESTS --with-xunit;
RC=$?;
if [ $RC -ne 255 ] && [ $RC -ne 0 ]; then
(exit $RC);
else
ERRORS=$(grep -c -e errors=\"[1-9] -e failures=\"[1-9] nosetests.xml);
echo "grep nosetests output:";
echo $(grep -e errors=\"[1-9] -e failures=\"[1-9] nosetests.xml);
if [ $ERRORS -ne 0 ]; then
(exit 1);
fi
fi
else
$NOSETESTS;
fi;
# Restore original $PATH so we run the python version of coveralls
after_success:
- if [ "$JYTHON" == "true" ]; then
export PATH=$OLD_PATH;
fi
- coveralls;
deploy:
provider: pypi
user: dls_controls
password:
secure: VFGRvZC15WvLiNqHGJMArbk4bZSjd7mBIC9u81JpHkRmWqGh2Hj8MIsftPMXUtAApmLMaD8m6GXmEoHvWjg87scG/U9E+gLAJmr9yyK/hdPUGSyjJwvCNAs3v+y5NQ9RYXJxIcsMWIDUJ5/JChQjwMyCk0gsilMORTWRY1q5HXiZliCutWmDc8Ym2W8e3Kn/xKbyZMPAnkAR7UnGDeTjVf24FRCRsukZn90o1Heb3LfUNfiKV4hfAzX+bXsl883FZ/179benh9In4UhN2yzCZu+XUi9PL9osXR3B807ZYfMOLnQaKqfsbCdD/i/fYPr3kOgbvGxNqvXXk8VLffmk0KOBAXWbveTIFsPZD7nHe27tfC7r6Binp8vNnmCHxI6/TuyNxBlNWNgKmJpbU8+7K0B1OTVGs/VQcaUcVp6mh5tGKfPjbii96PN6BvETNIMALRC9fYOsm0sXhBo85gIL46IqtcVbnj3uLlkScEElqe8PrFmW3cUKN7i/A8jrUpx/4TvtxeTUGHVhv5lBleHCvxhpH0E4a5w0HEEHvL0iQ93PgdHyGn3hmTfyO6/a4IymLY2s87n11275FbyPz1BZo9P3xDDFUuaxKxvoQMKs/xWhELS8lLruIMgfG4Xu8NZR2hs7pbobzEzfNZ74OepkuOkS8Ca3fq5Qm6jwv4fsGHI=
on:
tags: true
# As we are doing a source dist, only deploy for one python
python: "3.5"