@@ -14,29 +14,40 @@ cloneorpull() {
14
14
}
15
15
venv () {
16
16
if ! test -d " $1 " ; then
17
- virtualenv " $1 "
17
+ virtualenv -p python ${PYTHON_VERSION} " $1 "
18
18
fi
19
19
# shellcheck source=/dev/null
20
20
source " $1 " /bin/activate
21
21
}
22
- git clean --force -d -x || /bin/true
22
+
23
23
cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git
24
- venv cwltool-venv
25
24
docker pull node:slim
26
- export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
27
- pip install -U setuptools wheel pip
28
- python setup.py install
29
- pip install " cwltest>=1.0.20160825151655"
30
- pushd common-workflow-language
25
+ # clean both the repos before the loop
31
26
git clean --force -d -x || /bin/true
32
- # shellcheck disable=SC2154
33
- if [[ " $version " = * dev* ]]
34
- then
35
- EXTRA=" EXTRA=--enable-dev"
36
- fi
37
- ./run_test.sh --junit-xml=result.xml RUNNER=cwltool -j4 DRAFT=" ${version} " ${EXTRA}
38
- CODE=$?
39
- popd
27
+ git -C common-workflow-language clean --force -d -x || /bin/true
28
+
29
+ # Test for Python 2.7 and Python 3
30
+ for PYTHON_VERSION in 2.7 3
31
+ do
32
+ venv cwltool-venv${PYTHON_VERSION}
33
+ export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/
34
+ # use pip2.7 and pip3 in separate loop runs
35
+ pip${PYTHON_VERSION} install -U setuptools wheel pip
36
+ pip${PYTHON_VERSION} install .
37
+ pip${PYTHON_VERSION} install " cwltest>=1.0.20160825151655"
38
+ pushd common-workflow-language
39
+ # shellcheck disable=SC2154
40
+ if [[ " $version " = * dev* ]]
41
+ then
42
+ EXTRA=" EXTRA=--enable-dev"
43
+ fi
44
+ ./run_test.sh --junit-xml=result${PYTHON_VERSION} .xml RUNNER=cwltool -j4 DRAFT=${version}
45
+ CODE=$(( $CODE + $? )) # capture return code of ./run_test.sh
46
+ deactivate
47
+ popd
48
+ done
49
+
50
+ # build new docker container
40
51
if [ " $GIT_BRANCH " = " origin/master" ] && [[ " $version " = " v1.0" ]]
41
52
then
42
53
./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool
0 commit comments