Skip to content

Commit

Permalink
Automate phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
donatj committed Aug 1, 2024
1 parent 55b5cdf commit e41059b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
pull_request:
push:
branches:
- master

name: phpstan
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'

- name: Install dependencies with composer
run: composer install

- name: Cache phpstan cache
uses: actions/cache@v4
with:
path: .phpstan-cache
key: phpstan-cache-${{ github.run_id }} # see https://github.com/phpstan/phpstan/discussions/9301
restore-keys: |
phpstan-cache-
- name: PHPStan
run: make phpstan
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ generate:
init:
php bin/init_user_agent.php > tests/user_agents.tmp.json && mv tests/user_agents.tmp.json tests/user_agents.dist.json
make generate

.PHONY: phpstan
phpstan:
php vendor/bin/phpstan analyse --memory-limit 2g

0 comments on commit e41059b

Please sign in to comment.