1
1
#! /bin/bash
2
2
venv () {
3
3
if ! test -d " $1 " ; then
4
- virtualenv -p python " ${PYTHON_VERSION} " " $1 "
4
+ virtualenv -p python3 " $1 "
5
5
fi
6
6
# shellcheck source=/dev/null
7
7
source " $1 " /bin/activate
8
8
}
9
-
9
+ version= ${version :- v1.0}
10
10
if [[ " $version " = " v1.0" ]] ; then
11
11
wget https://github.com/common-workflow-language/common-workflow-language/archive/main.tar.gz
12
12
tar xzf main.tar.gz && rm main.tar.gz
13
13
else
14
- repo=$( echo $version | sed ' s/\(v[0-9]*\.\)\([0-9]*\).*/\1\2/' )
15
- wget https://github.com/common-workflow-language/cwl-${repo} /archive/main.tar.gz
14
+ # shellcheck disable=SC2001
15
+ repo=$( echo " $version " | sed ' s/\(v[0-9]*\.\)\([0-9]*\).*/\1\2/' )
16
+ wget https://github.com/common-workflow-language/cwl-" ${repo} " /archive/main.tar.gz
16
17
tar xzf main.tar.gz && rm main.tar.gz
17
18
fi
18
19
19
20
docker pull node:slim
20
21
21
- for PYTHON_VERSION in 3
22
- do
22
+ # shellcheck disable=SC2043
23
23
for CONTAINER in docker
24
24
# for CONTAINER in docker singularity
25
25
# singularity having issues on ci.commonwl.org; tests pass with https://gist.github.com/mr-c/0ec90d717617d074017c0cb38b72d1a4
26
26
do
27
- venv cwltool-venv${PYTHON_VERSION}
28
- # use pip2.7 and pip3 in separate loop runs
29
- pip${PYTHON_VERSION} install -U setuptools wheel pip
30
- pip${PYTHON_VERSION} uninstall -y cwltool
31
- pip${PYTHON_VERSION} install -e .
32
- pip${PYTHON_VERSION} install " cwltest>=1.0.20180518074130" codecov
27
+ venv cwltool-venv3
28
+ pip3 install -U setuptools wheel pip
29
+ pip3 uninstall -y cwltool
30
+ pip3 install -e .
31
+ pip3 install " cwltest>=1.0.20180518074130" codecov
33
32
if [[ " $version " = " v1.0" ]]
34
33
then
35
34
DRAFT=" DRAFT=v1.0"
36
35
pushd common-workflow-language-main || exit 1
37
36
else
38
- pushd cwl-${repo} -main || exit 1
37
+ pushd cwl-" ${repo} " -main || exit 1
39
38
fi
40
39
rm -f .coverage* coverage.xml
41
40
source=$( realpath ../cwltool)
@@ -55,7 +54,7 @@ ignore_errors = True
55
54
omit =
56
55
tests/*
57
56
EOF
58
- CWLTOOL_WITH_COV=${PWD} /cwltool_with_cov ${PYTHON_VERSION}
57
+ CWLTOOL_WITH_COV=${PWD} /cwltool_with_cov3
59
58
cat > " ${CWLTOOL_WITH_COV} " << EOF
60
59
#!/bin/bash
61
60
coverage run --parallel-mode --rcfile=${COVERAGE_RC} \
76
75
then
77
76
EXTRA=" EXTRA=${EXTRA} "
78
77
fi
79
- if [ " $GIT_BRANCH " = " origin/main" ] && [[ " $version " = " v1.0" ]] && [[ " $CONTAINER " = " docker" ]] && [ $PYTHON_VERSION -eq 3 ]
78
+ if [ " $GIT_BRANCH " = " origin/main" ] && [[ " $version " = " v1.0" ]] && [[ " $CONTAINER " = " docker" ]]
80
79
then
81
80
rm -Rf conformance
81
+ # shellcheck disable=SC2154
82
82
git clone http://" ${jenkins_cwl_conformance} " @github.com/common-workflow-language/conformance.git
83
83
84
84
git -C conformance config user.email
" [email protected] "
85
85
git -C conformance config user.name " CWL Jenkins build bot"
86
86
CONFORMANCE_MSG=$( cat << EOM
87
87
Conformance test of cwltool ${tool_ver} for CWL ${version}
88
88
Commit: ${GIT_COMMIT}
89
- Python version: ${PYTHON_VERSION}
89
+ Python version: 3
90
90
Container: ${CONTAINER}
91
91
EOM
92
92
)
98
98
BADGE=" --badgedir=${badgedir} "
99
99
fi
100
100
# shellcheck disable=SC2086
101
- LC_ALL=C.UTF-8 ./run_test.sh --junit-xml=result ${PYTHON_VERSION} .xml \
101
+ LC_ALL=C.UTF-8 ./run_test.sh --junit-xml=result3 .xml \
102
102
RUNNER=${CWLTOOL_WITH_COV} " -j$( nproc) " ${BADGE} \
103
103
${DRAFT} " ${EXTRA} " \
104
- " --classname=py ${PYTHON_VERSION} _ ${CONTAINER} "
104
+ " --classname=py3_ ${CONTAINER} "
105
105
# LC_ALL=C is to work around junit-xml ASCII only bug
106
106
CODE=$(( CODE+ $? )) # capture return code of ./run_test.sh
107
- coverage combine " --rcfile=${COVERAGE_RC} " $( find . -name ' .coverage.*' )
107
+ coverage combine " --rcfile=${COVERAGE_RC} " " $( find . -name ' .coverage.*' ) "
108
108
coverage xml " --rcfile=${COVERAGE_RC} "
109
109
codecov --file coverage.xml
110
110
111
111
if [ -d conformance ]
112
112
then
113
- rm -rf conformance/cwltool/cwl_${version} /cwltool_latest
114
- cp -r conformance/cwltool/cwl_${version} /cwltool_${tool_ver} conformance/cwltool/cwl_${version} /cwltool_latest
113
+ rm -rf conformance/cwltool/cwl_" ${version} " /cwltool_latest
114
+ cp -r conformance/cwltool/cwl_" ${version} " /cwltool_" ${tool_ver} " conformance/cwltool/cwl_" ${version} " /cwltool_latest
115
115
git -C conformance add --all
116
116
git -C conformance diff-index --quiet HEAD || git -C conformance commit -m " ${CONFORMANCE_MSG} "
117
- git -C conformance push http://
${jenkins_cwl_conformance} :
[email protected] /common-workflow-language/conformance.git
117
+ git -C conformance push http://
" ${jenkins_cwl_conformance} " :
[email protected] /common-workflow-language/conformance.git
118
118
fi
119
119
120
120
deactivate
121
- popd
122
- done
121
+ popd || exit
123
122
done
124
123
# build new docker container
125
124
if [ " $GIT_BRANCH " = " origin/main" ] && [[ " $version " = " v1.0" ]]
0 commit comments