2020-04-22 07:44:15 +00:00
|
|
|
name: "PHPStan"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'doc/**'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'doc/**'
|
|
|
|
|
|
|
|
env:
|
2020-11-12 11:59:48 +00:00
|
|
|
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
|
2020-04-22 07:44:15 +00:00
|
|
|
SYMFONY_PHPUNIT_VERSION: ""
|
|
|
|
|
2022-06-10 00:30:11 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-04-22 07:44:15 +00:00
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: "PHPStan"
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version:
|
|
|
|
- "7.4"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout"
|
2022-03-05 18:17:37 +00:00
|
|
|
uses: "actions/checkout@v3"
|
2020-04-22 07:44:15 +00:00
|
|
|
|
|
|
|
- name: "Install PHP"
|
|
|
|
uses: "shivammathur/setup-php@v2"
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
2020-06-16 08:05:44 +00:00
|
|
|
extensions: "intl, zip"
|
2020-04-22 07:44:15 +00:00
|
|
|
ini-values: "memory_limit=-1"
|
|
|
|
php-version: "${{ matrix.php-version }}"
|
|
|
|
|
|
|
|
- name: "Determine composer cache directory"
|
|
|
|
id: "determine-composer-cache-directory"
|
|
|
|
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
|
|
|
|
|
|
|
|
- name: "Cache dependencies installed with composer"
|
2020-08-18 09:23:09 +00:00
|
|
|
uses: "actions/cache@v2"
|
2020-04-22 07:44:15 +00:00
|
|
|
with:
|
|
|
|
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
|
|
|
|
key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
|
|
|
|
restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
|
|
|
|
|
2020-04-22 08:33:36 +00:00
|
|
|
- name: "Install highest dependencies from composer.json using composer binary provided by system"
|
|
|
|
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
|
2020-04-22 07:44:15 +00:00
|
|
|
|
2021-10-27 12:54:36 +00:00
|
|
|
- name: "Install PHPStan"
|
2020-09-11 09:52:54 +00:00
|
|
|
# Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
|
2022-01-21 11:48:16 +00:00
|
|
|
run: "bin/composer require --dev phpstan/phpstan:1.4.* phpstan/phpstan-phpunit:1.0.* phpstan/phpstan-deprecation-rules:1.0.* phpstan/phpstan-strict-rules:1.1.* phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}"
|
2021-10-27 12:54:36 +00:00
|
|
|
|
|
|
|
- name: "Run PHPStan"
|
|
|
|
run: "vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
|