-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
test_all_versions.sh
executable file
·80 lines (72 loc) · 2.36 KB
/
test_all_versions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# docker run --rm -v $(pwd):/app -w /app composer install
function displayTitle {
echo -e "\e[1m*** Testing with \e[92m$1\e[39m\e[0m ***"
}
function version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}
echo Checking Docker is running...
podman version
podman_status=$?
if test $podman_status -gt 0
then
echo "Error: podman is not running correctly ???"
exit 1
fi
# i=0
# while [ $? == 0 ]
# do
# i=$((i+1))
# curl https://registry.hub.docker.com/v2/repositories/library/php/tags/?page=$i 2>/dev/null|jq '."results"[]["name"]'
# done
# exit
COMPOSER_CURRENT=$(composer show 'phpunit/phpunit' | grep -Eow "[0-9\.]+" -m 1 )
# if version_gt $COMPOSER_CURRENT "6.5"; then
# composer remove phpunit/phpunit theseer/phpdox
# composer require phpunit/phpunit:^6.5
# fi
declare -A versions
# 7.key.value
versions[1]=30
versions[2]=24
versions[3]=12
onlyMinor=1
command="vendor/bin/phpunit \
-c ./configuration/phpunit.xml \
--testsuite All --no-coverage --columns 160 --disallow-test-output"
# --testsuite units --no-coverage --columns 160 --disallow-test-output --no-logging"
for minor in "${!versions[@]}"
do
echo "********************* testing PHP 8.$minor ***************************"
tag="cli-alpine"
if test $minor -eq 0
then
tag="cli"
fi
if [ $onlyMinor != 1 ]
then
for patch in `seq 0 ${versions[$minor]}`
do
displayTitle "8.$minor.$patch"
podman run --rm --privileged -v $(pwd):/app -w /app php:8.$minor.$patch-$tag $command
done
else
patch=${versions[$minor]}
displayTitle "8.$minor.$patch"
podman run --rm --privileged -v $(pwd):/app -w /app php:8.$minor.$patch-$tag $command
fi
done
# php composer.phar self-update 1.7.0
# for v in "${versions[@]}"
# do
# echo -e "\e[1m*** Testing with \e[92m$v\e[39m\e[0m ***"
# docker run --rm -v $(pwd):/app -w /app php:$v vendor/bin/phpunit --configuration ./configuration/phpunit.xml --testsuite All --no-coverage --columns 160 --disallow-test-output --do-not-cache-result --no-logging
# done
# php composer.phar self-update 1.9.0
#
# if version_gt $COMPOSER_CURRENT "6.5"; then
# composer self-update
# composer require --dev theseer/phpdox
# composer update phpunit/phpunit
# fi