2020-04-22 07:44:15 +00:00
|
|
|
name: "PHPStan"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'doc/**'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'doc/**'
|
|
|
|
|
|
|
|
env:
|
2022-03-26 13:41:55 +00:00
|
|
|
COMPOSER_FLAGS: "--ansi --no-interaction --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
|
2021-12-10 12:13:53 +00:00
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
2020-04-22 07:44:15 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-12-10 12:13:53 +00:00
|
|
|
include:
|
|
|
|
- php-version: "7.2"
|
|
|
|
experimental: false
|
|
|
|
- php-version: "8.1"
|
|
|
|
experimental: true
|
2021-12-09 12:02:20 +00:00
|
|
|
fail-fast: false
|
2020-04-22 07:44:15 +00:00
|
|
|
|
|
|
|
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"
|
2022-10-25 09:54:48 +00:00
|
|
|
run: "echo \"directory=$(composer config cache-dir)\" >> $GITHUB_OUTPUT"
|
2020-04-22 07:44:15 +00:00
|
|
|
|
|
|
|
- name: "Cache dependencies installed with composer"
|
2022-06-30 13:17:38 +00:00
|
|
|
uses: "actions/cache@v3"
|
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 }}"
|
|
|
|
|
2021-12-09 10:35:09 +00:00
|
|
|
- name: "Install highest dependencies"
|
2021-12-10 12:13:53 +00:00
|
|
|
if: "matrix.experimental == true"
|
2020-04-22 08:33:36 +00:00
|
|
|
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
|
2020-04-22 07:44:15 +00:00
|
|
|
|
2021-12-09 10:35:09 +00:00
|
|
|
- name: "Install locked dependencies"
|
2021-12-10 12:13:53 +00:00
|
|
|
if: "matrix.experimental == false"
|
2022-03-26 13:41:55 +00:00
|
|
|
run: "composer config platform --unset && composer install ${{ env.COMPOSER_FLAGS }}"
|
2021-12-09 10:35:09 +00:00
|
|
|
|
|
|
|
- name: "Initialize PHPUnit sources"
|
|
|
|
run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS"
|
|
|
|
|
2021-10-27 12:54:36 +00:00
|
|
|
- name: "Run PHPStan"
|
2021-12-08 16:03:05 +00:00
|
|
|
run: "composer phpstan"
|