Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket/phpstan and fixes #2055

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
47 changes: 47 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'PHPStan Tests'
on:
pull_request:
paths:
- 'src/**.php'
- '*.php'
jobs:
phpstan:
strategy:
matrix:
phpVersion: [
"7.4",
"8.0",
"8.1",
"8.2",
"8.3",
]
runs-on: ubuntu-20.04
steps:
- name: Checkout the repository
uses: actions/checkout@v2
with:
fetch-depth: 1000
submodules: recursive
# ------------------------------------------------------------------------------
# Set up PHP and run phpstan
# ------------------------------------------------------------------------------
- name: Configure PHP environment to run phpstan
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersion }}
# ------------------------------------------------------------------------------
# Override composer php version
# ------------------------------------------------------------------------------
- name: Set php version ${{ matrix.phpVersion }} in composer
run: composer config platform.php ${{ matrix.phpVersion }}
# ------------------------------------------------------------------------------
# Install dependencies - ignoring php requirements
# ------------------------------------------------------------------------------
- name: Install dependencies
run: composer i --ignore-platform-req=php+
# ------------------------------------------------------------------------------
# Run phpstan
# ------------------------------------------------------------------------------
- name: Run phpstan
run: ./vendor/bin/phpstan analyse --error-format=table

6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
"lucatume/codeception-snapshot-assertions": "^0.2.4",
"lucatume/function-mocker-le": "^1.0",
"lucatume/wp-browser": "^3.0.14",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "~6.0",
"stellarwp/coding-standards": "2.0",
"stellarwp/coding-standards": "dev-main",
"szepeviktor/phpstan-wordpress": "*",
"the-events-calendar/tec-testing-facilities": "dev-master",
"wp-cli/checksum-command": "1.0.5",
"wp-coding-standards/wpcs": "^3.0"
Expand Down
Loading
Loading