Skip to content

Commit

Permalink
Merge pull request #786 from Automattic/3.0/feature/ghactions-add-php…
Browse files Browse the repository at this point in the history
…stan
  • Loading branch information
GaryJones authored Aug 26, 2023
2 parents 70d9953 + a6b8113 commit 238ac94
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/.github export-ignore
/bin export-ignore
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,31 @@ jobs:
# At a later stage the documentation check can be activated.
- name: Check sniff feature completeness
run: composer feature-completeness

phpstan:
name: "PHPStan"

runs-on: "ubuntu-latest"

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: phpstan

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Run PHPStan
run: phpstan analyse
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ phpcs.xml
.phpcs.xml
phpunit.xml
phpcs.cache
phpstan.neon
13 changes: 13 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
#phpVersion: 50400 # Needs to be 70100 or higher... sigh...
level: 5
paths:
- WordPressVIPMinimum
- tests
bootstrapFiles:
- tests/bootstrap.php
scanDirectories:
- vendor/wp-coding-standards/wpcs/WordPress
treatPhpDocTypesAsCertain: false

ignoreErrors:

0 comments on commit 238ac94

Please sign in to comment.