Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ 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.

**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:
Expand Down
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 $*"