File tree Expand file tree Collapse file tree 34 files changed +370
-349
lines changed
Expand file tree Collapse file tree 34 files changed +370
-349
lines changed Original file line number Diff line number Diff line change 99# php-parallel-process
1010
1111Work in progress ;)
12+
13+ # Installation
14+
15+ ```
16+ composer require steevanb/php-parallel-processes ^0.1
17+ ```
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
78
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --rm \
12- --tty \
13- ${DOCKER_INTERACTIVE_PARAMETER} \
14- --volume " ${rootDir} " :/app:ro \
15- --entrypoint bin/ci/" $( basename " ${0} " ) " \
16- --workdir /app \
17- steevanb/php-parallel-process:ci
18- exit 0
19- fi
20-
21- composer-require-checker --ansi
9+ composer-require-checker --ansi " ${@ } "
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
7-
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --rm \
12- --tty \
13- ${DOCKER_INTERACTIVE_PARAMETER} \
14- --volume " ${rootDir} " :/app \
15- --user " $( id -u) " :" $( id -g) " \
16- --entrypoint bin/ci/" $( basename " ${0} " ) " \
17- --workdir /app \
18- --env COMPOSER_HOME=/app/var/composer \
19- steevanb/php-parallel-process:ci
20- exit 0
21- fi
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
228
239composer validate --ansi --strict
Original file line number Diff line number Diff line change 33set -eu
44
55readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- readonly DOCKER_IMAGE_NAME=" steevanb/php-parallel-process:ci"
7- readonly DOCKER_FILE_PATH=" ${ROOT_DIR} /docker/ci"
6+ source " ${ROOT_DIR} " /bin/common.inc.sh
87
9- source " ${ROOT_DIR} /bin/docker.inc.bash"
8+ DOCKER_IMAGE_NAME=" ${CI_DOCKER_IMAGE_NAME} " \
9+ DOCKER_FILE_PATH=" ${ROOT_DIR} " /docker/ci/Dockerfile \
10+ source " ${ROOT_DIR} " /bin/docker-build.inc.bash
Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /usr/bin/env sh
22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
68
7- " ${rootDir } " /bin/composer install
9+ " ${ROOT_DIR } " /bin/composer install
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
78
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --tty \
12- ${DOCKER_INTERACTIVE_PARAMETER} \
13- --volume " ${rootDir} " :/app \
14- --user " $( id -u) " :" $( id -g) " \
15- --entrypoint bin/ci/" $( basename " ${0} " ) " \
16- --workdir /app \
17- steevanb/php-parallel-process:ci \
18- " ${@ } "
19- exit 0
20- fi
219
2210XDEBUG_MODE=coverage \
2311 infection \
24- --configuration=config/ci /infection.json \
12+ --configuration=config/release /infection.json \
2513 --threads=10 \
2614 --only-covered \
2715 --ansi \
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
78
8- createCacheDir () {
9- if [ ! -d " ${rootDir} " /var/ci/phpcs ]; then
10- mkdir -p " ${rootDir} " /var/ci/phpcs
11- fi
12- }
13-
14- if ! ${IS_IN_DOCKER} ; then
15- createCacheDir
16-
17- docker \
18- run \
19- --tty \
20- ${DOCKER_INTERACTIVE_PARAMETER} \
21- --volume " ${rootDir} " :/app:ro \
22- --volume " ${rootDir} " /var/ci/phpcs:/app/var/ci/phpcs \
23- --user " $( id -u) " :" $( id -g) " \
24- --entrypoint bin/ci/" $( basename " ${0} " ) " \
25- --workdir /app \
26- steevanb/php-parallel-process:ci \
27- " ${@ } "
28- exit 0
9+ if [ ! -d " ${ROOT_DIR} " /var/ci/phpcs ]; then
10+ mkdir -p " ${ROOT_DIR} " /var/ci/phpcs
2911fi
3012
31- createCacheDir
32-
3313phpcs \
3414 -p \
3515 --warning-severity=0 \
3616 --ignore=/vendor/,/var/ \
3717 --bootstrap=config/ci/phpcs.php \
3818 --standard=" ${COMPOSER_HOME} " /vendor/steevanb/php-code-sniffs/src/Steevanb/ruleset.xml \
3919 --report=steevanb\\ PhpCodeSniffs\\ Reports\\ Steevanb \
40- --cache=var/ci/phpcs/cache \
20+ --cache=" ${ROOT_DIR} " / var/ci/phpcs/cache \
4121 . \
4222 " ${@ } "
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
78
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --rm \
12- --tty \
13- ${DOCKER_INTERACTIVE_PARAMETER} \
14- --volume " ${rootDir} " :/app:ro \
15- --entrypoint bin/ci/" $( basename " ${0} " ) " \
16- --workdir /app \
17- steevanb/php-parallel-process:ci
18- exit 0
19- fi
20-
21- phpdd --ansi src
9+ phpdd --ansi --exclude=vendor,var " ${@ } " .
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
7-
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --rm \
12- --tty \
13- ${DOCKER_INTERACTIVE_PARAMETER} \
14- --volume " ${rootDir} " :/app \
15- --user " $( id -u) " :" $( id -g) " \
16- --entrypoint bin/ci/" $( basename " ${0} " ) " \
17- --workdir /app \
18- steevanb/php-parallel-process:ci
19- exit 0
20- fi
21-
22- phpstan analyse --ansi -c config/ci/phpstan.neon
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
8+
9+ phpstan \
10+ analyse \
11+ --ansi \
12+ --configuration config/ci/phpstan.neon
Original file line number Diff line number Diff line change 22
33set -eu
44
5- readonly rootDir=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6- . " ${rootDir} /bin/common.inc.sh"
7-
8- if ! ${IS_IN_DOCKER} ; then
9- docker \
10- run \
11- --rm \
12- --tty \
13- ${DOCKER_INTERACTIVE_PARAMETER} \
14- --volume " ${rootDir} " :/app \
15- --user " $( id -u) " :" $( id -g) " \
16- --entrypoint bin/ci/" $( basename " ${0} " ) " \
17- --workdir /app \
18- steevanb/php-parallel-process:ci \
19- " ${@ } "
20- exit 0
21- fi
5+ readonly ROOT_DIR=" $( realpath " $( dirname " $( realpath " $0 " ) " ) /../.." ) "
6+ . " ${ROOT_DIR} " /bin/common.inc.sh
7+ . " ${ROOT_DIR} " /bin/dockerise.inc.bash
228
239phpVersion=
2410symfonyVersion=
@@ -34,13 +20,15 @@ for arg in "${@}"; do
3420done
3521
3622if [ " ${phpVersion} " == " " ] || [ " ${symfonyVersion} " == " " ]; then
37- php8.0 " ${rootDir } " /bin/ci/phpunit.php " ${@ } "
23+ php8.0 " ${ROOT_DIR } " /bin/ci/phpunit.php " ${@ } "
3824else
3925 echo " PHP ${phpVersion} - Symfony ${symfonyVersion} "
4026
27+ readonly composerHomeVarName=" COMPOSER_HOME_SYMFONY_${symfonyVersion/ ./ _} "
28+
4129 " php${phpVersion} " \
4230 vendor/bin/phpunit \
43- --bootstrap " ${COMPOSER_HOME_SYMFONY_5_0} " /vendor/autoload.php \
4431 --configuration config/ci/phpunit.xml \
32+ --bootstrap ${! composerHomeVarName} /vendor/autoload.php \
4533 ${phpunitParameters}
4634fi
You can’t perform that action at this time.
0 commit comments