Skip to content

Commit

Permalink
Add PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesChou committed Nov 19, 2019
1 parent 3da73ec commit 233e970
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ jobs:
with:
args: --version

- name: Test for PHP PhpMetrics on PHP 7.0
- name: Test for PHP PhpMetrics on PHP 5.5
uses: mileschou/php-tools-action/5.5/phpmetrics@master
with:
args: --help
- name: Test for PHP PhpMetrics
uses: mileschou/php-tools-action/phpmetrics@master
with:
args: --help

- name: Test for PHPStan
uses: mileschou/php-tools-action/phpstan@master
with:
args: --help
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ With args
args: some.php
```

### `phpstan`

> See https://github.com/phpstan/phpstan

Run with default config.

```yaml
- uses: MilesChou/php-tools-action/phpstan@master
```

With args

```yaml
- uses: MilesChou/php-tools-action/phpstan@master
with:
args: some.php
```

> PHPStan require PHP ^7.1, so just support PHP 7.3.

### `phpunit`

> See https://github.com/sebastianbergmann/phpunit
Expand Down
6 changes: 6 additions & 0 deletions phpstan/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM php:7.3-alpine

COPY docker-install-phpstan /usr/local/bin/
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh", "phpstan"]
8 changes: 8 additions & 0 deletions phpstan/docker-install-phpstan
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

echo "Download from https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar ..."
curl -LOs https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
chmod +x phpstan.phar
mv phpstan.phar /usr/local/bin/phpstan
7 changes: 7 additions & 0 deletions phpstan/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -l

set -e

docker-install-phpstan

exec $@

0 comments on commit 233e970

Please sign in to comment.