Skip to content

Commit

Permalink
✅ Add PHPStan workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MatzeKitt committed Oct 5, 2024
1 parent 48a7ad8 commit 26f733c
Show file tree
Hide file tree
Showing 7 changed files with 463 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/exclude_list
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
node_modules/
src/
composer.json
composer.lock
package.json
package-lock.json
ruleset.xml
webpack.config.js
*scss/
.git*
phpstan.neon.dist
.phpcs.xml
20 changes: 20 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PHPStan

on: [workflow_call]

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

steps:
- uses: actions/checkout@v4
- name: Install composer dependencies
uses: php-actions/composer@v6
- name: PHPStan static analysis
uses: php-actions/phpstan@v3
with:
args: -v
configuration: phpstan.neon.dist
memory_limit: 2G
path: inc/ multisite-auto-language-switcher.php
php_version: 7.4
3 changes: 3 additions & 0 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
- "*"
- "!*-*"
jobs:
tests:
uses: ./.github/workflows/phpstan.yml
tag:
name: New tag
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"scripts": {
"phpstan": "phpstan analyse -v --memory-limit=2048M"
},
"require-dev": {
"phpstan/phpstan": "^1.12",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpstan/extension-installer": "^1.4",
"swissspidy/phpstan-no-private": "^0.2.1",
"phpstan/phpstan-deprecation-rules": "^1.2"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Loading

0 comments on commit 26f733c

Please sign in to comment.