From f7f5d6d68a4ed0526bac18057a4c9e1f7d78ad11 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Sun, 27 Jan 2019 11:44:18 +0100 Subject: [PATCH 1/3] Allow installing extra packages when needed --- entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index bd6923a..af6fb4c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,15 @@ #!/bin/sh -l +======= +if [[ ! -z "$PHP_EXTENSIONS" ]]; then + echo "installing $PHP_EXTENSIONS" + apk add -q --no-cache $PHP_EXTENSIONS; + rm -rf /var/cache/apk/*; +fi + +if [[ ! -z "$COMPOSER_PACKAGES" ]]; then + echo "installing $COMPOSER_PACKAGES" + composer global require --quiet $COMPOSER_PACKAGES; +fi + sh -c "composer install --no-scripts --no-progress && /composer/vendor/bin/phpstan $*" From 9b17f49c643d161597ade10d43ccdfbebc8abc38 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Sun, 27 Jan 2019 11:52:03 +0100 Subject: [PATCH 2/3] Add documentation for new environment variables --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 9d77f3e..e26779f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,15 @@ action "PHPStan" { **You can copy/paste the .github folder (under examples/) to your project and thats all!** +## PHPStan plugins +You might want to add extra plugins to phpstan to be more strict. To install them define +`COMPOSER_PACKAGES` as environment variable in your workflow. + +## Additional Alpine packages +The docker image contains a minimal set of installed php packages. For some projects you +might want to add more php extensions. Define `PHP_EXTENSIONS` as environment variable in +your workflow to do so. + ## Docker A Docker-Image is built automatically and located here: From dfd957d009fe4e7575e4956cb464a1d4e72b5d26 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Sun, 24 Feb 2019 11:59:13 +0100 Subject: [PATCH 3/3] Add warning about speed --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e26779f..ff3322d 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,16 @@ action "PHPStan" { You might want to add extra plugins to phpstan to be more strict. To install them define `COMPOSER_PACKAGES` as environment variable in your workflow. +**Please note that installing plugins using the environment variable has impact on the execution time. To speed up your workflow push a prepared image to a docker repository** + ## Additional Alpine packages The docker image contains a minimal set of installed php packages. For some projects you might want to add more php extensions. Define `PHP_EXTENSIONS` as environment variable in your workflow to do so. +**Please note that installing packages using the environment variable has impact on the execution time. To speed up your workflow push a prepared image to a docker repository** + + ## Docker A Docker-Image is built automatically and located here: