diff --git a/jenkins.bash b/jenkins.bash index bec40c2de..583fe6607 100755 --- a/jenkins.bash +++ b/jenkins.bash @@ -14,29 +14,40 @@ cloneorpull() { } venv() { if ! test -d "$1" ; then - virtualenv "$1" + virtualenv -p python${PYTHON_VERSION} "$1" fi # shellcheck source=/dev/null source "$1"/bin/activate } -git clean --force -d -x || /bin/true + cloneorpull common-workflow-language https://github.com/common-workflow-language/common-workflow-language.git -venv cwltool-venv docker pull node:slim -export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/ -pip install -U setuptools wheel pip -python setup.py install -pip install "cwltest>=1.0.20160825151655" -pushd common-workflow-language +# clean both the repos before the loop git clean --force -d -x || /bin/true -# shellcheck disable=SC2154 -if [[ "$version" = *dev* ]] -then - EXTRA="EXTRA=--enable-dev" -fi -./run_test.sh --junit-xml=result.xml RUNNER=cwltool -j4 DRAFT="${version}" ${EXTRA} -CODE=$? -popd +git -C common-workflow-language clean --force -d -x || /bin/true + +# Test for Python 2.7 and Python 3 +for PYTHON_VERSION in 2.7 3 +do + venv cwltool-venv${PYTHON_VERSION} + export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pypi-cache/ + # use pip2.7 and pip3 in separate loop runs + pip${PYTHON_VERSION} install -U setuptools wheel pip + pip${PYTHON_VERSION} install . + pip${PYTHON_VERSION} install "cwltest>=1.0.20160825151655" + pushd common-workflow-language + # shellcheck disable=SC2154 + if [[ "$version" = *dev* ]] + then + EXTRA="EXTRA=--enable-dev" + fi + ./run_test.sh --junit-xml=result${PYTHON_VERSION}.xml RUNNER=cwltool -j4 DRAFT=${version} + CODE=$(($CODE+$?)) # capture return code of ./run_test.sh + deactivate + popd +done + +# build new docker container if [ "$GIT_BRANCH" = "origin/master" ] && [[ "$version" = "v1.0" ]] then ./build-cwl-docker.sh && docker push commonworkflowlanguage/cwltool_module && docker push commonworkflowlanguage/cwltool