55# stop on first error
66set -eu -o errtrace -o pipefail
77
8+ MULTI_PYTHON=" " # set to test multi python envs
9+ PYTHON_VERSIONS=(" 3.6" " 3.7" " 3.8" " 3.9" " 3.10" " 3.11" " 3.12" " 3.13" " 3.14" )
10+
11+ test ()
12+ {
13+ echo " => python version:"
14+ python3 --version
15+
16+ # test syntax
17+ echo " checking syntax..."
18+ " ${cur} " /scripts/check-syntax.sh
19+
20+ # unittest
21+ echo " unittest..."
22+ " ${cur} " /scripts/check-unittests.sh
23+
24+ # tests-ng
25+ if [ -n " ${in_cicd} " ]; then
26+ # in CI/CD
27+ export DOTDROP_WORKERS=1
28+ echo " tests-ng with ${DOTDROP_WORKERS} worker(s)..."
29+ " ${cur} " /scripts/check-tests-ng.sh
30+
31+ export DOTDROP_WORKERS=4
32+ echo " tests-ng with ${DOTDROP_WORKERS} worker(s)..."
33+ " ${cur} " /scripts/check-tests-ng.sh
34+ else
35+ echo " tests-ng..."
36+ " ${cur} " /scripts/check-tests-ng.sh
37+ fi
38+ }
39+
840cur=$( cd " $( dirname " ${0} " ) " && pwd)
941in_cicd=" ${GITHUB_WORKFLOW:- } "
1042
@@ -24,32 +56,40 @@ if [ "${dotdrop_version}" != "${man_version}" ]; then
2456fi
2557echo " current dotdrop version ${dotdrop_version} "
2658
27- echo " => python version:"
28- python3 --version
29-
30- # test syntax
31- echo " checking syntax..."
32- " ${cur} " /scripts/check-syntax.sh
33-
34- # unittest
35- echo " unittest..."
36- " ${cur} " /scripts/check-unittests.sh
37-
38- # tests-ng
3959if [ -n " ${in_cicd} " ]; then
40- # in CI/CD
41- export DOTDROP_WORKERS=1
42- echo " tests-ng with ${DOTDROP_WORKERS} worker(s)..."
43- " ${cur} " /scripts/check-tests-ng.sh
44-
45- export DOTDROP_WORKERS=4
46- echo " tests-ng with ${DOTDROP_WORKERS} worker(s)..."
47- " ${cur} " /scripts/check-tests-ng.sh
60+ test
4861else
49- echo " tests-ng..."
50- " ${cur} " /scripts/check-tests-ng.sh
62+ if [ -n " ${MULTI_PYTHON} " ]; then
63+ if ! hash pyenv & > /dev/null; then
64+ echo " install pyenv"
65+ exit 1
66+ fi
67+
68+ eval " $( pyenv init -) "
69+ for PY in " ${PYTHON_VERSIONS[@]} " ; do
70+ echo " ============== python ${PY} =============="
71+ pyenv install -s " ${PY} "
72+ pyenv shell " ${PY} "
73+ python -m venv " .venv"
74+ source " .venv/bin/activate"
75+ pip install pip --upgrade
76+ pip install -r requirements.txt
77+ pip install -r tests-requirements.txt
78+ test
79+ deactivate
80+ done
81+ else
82+ python3 -m venv " .venv"
83+ source " .venv/bin/activate"
84+ pip install pip --upgrade
85+ pip install -r requirements.txt
86+ pip install -r tests-requirements.txt
87+ test
88+ deactivate
89+ fi
5190fi
5291
92+
5393# merge coverage
5494coverage combine coverages/*
5595coverage xml
0 commit comments