22
33set -e
44
5- PY_DOCKER_IMAGES=()
6- if [ -n " $TEST_PY_VERSION " ]; then
7- PY_VERSIONS+=(" $TEST_PY_VERSION " )
8- else
9- PY_VERSIONS+=(" 2.7" )
10- PY_VERSIONS+=(" 3.7" )
11- PY_VERSIONS+=(" 3.8" )
12- PY_VERSIONS+=(" 3.9" )
13- PY_VERSIONS+=(" 3.10" )
14- PY_VERSIONS+=(" 3.11" )
15- PY_VERSIONS+=(" 3.12" )
16- PY_VERSIONS+=(" 3.13" )
17- fi
18-
19- PY_PACKAGES=()
20- if [ -z " $TEST_LOCAL_PKG " ] || [ " $TEST_LOCAL_PKG " = " true" ]; then
21- PY_PACKAGES+=(" local" )
22- fi
23- if [ -z " $TEST_PYPI_PKG " ] || [ " $TEST_PYPI_PKG " = " true" ]; then
24- PY_PACKAGES+=(" editorconfig-checker" )
25- fi
26-
27-
285build_docker_image_and_run () {
296 local py_docker_image=" $1 "
307 local package=" $2 "
318
32- # Build
339 local docker_image=" editorconfig-checker-$py_docker_image -$package :latest"
3410
3511 docker_package=" $package "
@@ -46,20 +22,38 @@ build_docker_image_and_run() {
4622 --build-arg " PACKAGE=$docker_package " \
4723 .
4824
49- # Run `editorconfig-checker`
5025 docker run --rm " $docker_image " ec -version
5126}
5227
5328main () {
5429 echo -e " Running tests...\n\n"
5530
56- for py_version in " ${PY_VERSIONS[@]} " ; do
57- for package in " ${PY_PACKAGES[@]} " ; do
58- echo " Building docker image with python version $py_version and $package package. It could take some time..."
59- build_docker_image_and_run " $py_version -slim" " $package "
31+ local py_versions=()
32+ if [ -n " $TEST_PY_VERSION " ]; then
33+ py_versions+=(" $TEST_PY_VERSION " )
34+ else
35+ py_versions+=(" 2.7" )
36+ py_versions+=(" 3.7" )
37+ py_versions+=(" 3.8" )
38+ py_versions+=(" 3.9" )
39+ py_versions+=(" 3.10" )
40+ py_versions+=(" 3.11" )
41+ py_versions+=(" 3.12" )
42+ py_versions+=(" 3.13" )
43+ fi
6044
61- # docker image rm "$docker_image" &> /dev/null
45+ local py_packages=()
46+ if [ -z " $TEST_LOCAL_PKG " ] || [ " $TEST_LOCAL_PKG " = " true" ]; then
47+ py_packages+=(" local" )
48+ fi
49+ if [ -z " $TEST_PYPI_PKG " ] || [ " $TEST_PYPI_PKG " = " true" ]; then
50+ py_packages+=(" editorconfig-checker" )
51+ fi
6252
53+ for py_version in " ${py_versions[@]} " ; do
54+ for package in " ${py_packages[@]} " ; do
55+ echo " Building docker image with Python version $py_version and $package package. It could take some time..."
56+ build_docker_image_and_run " $py_version -slim" " $package "
6357 echo -e " \n"
6458 done
6559 done
0 commit comments