diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cf05c4152a..71443b35a2 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -30,6 +30,18 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Cache PHP_CodeSniffer intermediates + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/phpcs + key: ${{ runner.os }}-phpcs + + - name: Cache PHPStan intermediates + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/phpstan + key: ${{ runner.os }}-phpstan + - name: Install Composer dependencies run: > composer install \ @@ -39,10 +51,17 @@ jobs: - name: Run PHP_CodeSniffer if: always() - run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings + run: > + ./vendor/bin/phpcs \ + -q \ + --cache=${{ runner.temp }}/phpcs/cache.json \ + --report=checkstyle \ + | cs2pr --graceful-warnings - name: Run PHPStan if: always() + env: + PHPSTAN_TMP_DIR: ${{ runner.temp }}/phpstan run: ./vendor/bin/phpstan analyse --error-format=github --no-progress test: diff --git a/phpstan.neon b/phpstan.neon index 915ee8811e..6c75c7d894 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ parameters: - tmpDir: phpstan/ + includes: + - phpstan.neon.php level: 1 paths: - bin/ diff --git a/phpstan.neon.php b/phpstan.neon.php new file mode 100644 index 0000000000..c46879f0aa --- /dev/null +++ b/phpstan.neon.php @@ -0,0 +1,5 @@ + getenv("PHPSTAN_TMP_DIR", true) ?: "", +];