@@ -14,29 +14,40 @@ cloneorpull() {
1414}
1515venv () {
1616 if ! test -d " $1 " ; then
17- virtualenv " $1 "
17+ virtualenv -p python ${PYTHON_VERSION} " $1 "
1818 fi
1919 # shellcheck source=/dev/null
2020 source " $1 " /bin/activate
2121}
22- git clean --force -d -x || /bin/true
22+
2323cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git
24- venv cwltool-venv
2524docker 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
3126git 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
4051if [ " $GIT_BRANCH " = " origin/master" ] && [[ " $version " = " v1.0" ]]
4152then
4253 ./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool
0 commit comments