Skip to content

Commit

Permalink
Run PHPStan only on PHP 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Feb 4, 2021
1 parent 71dba3d commit 286e436
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ jobs:
run: |
composer run-script phpcs
- name: PHP Static Analysis Tool
run: |
composer run-script phpstan -- --no-progress
- name: Unit tests
run: |
vendor/bin/phpunit -c phpunit.xml.dist
Expand All @@ -71,3 +67,43 @@ jobs:
vendor/bin/phpunit -c phpunit-integration-tests.xml
env:
TEST_SUITE: oss

phpstan:
name: Static Analysis
runs-on: ${{ matrix.os }}

strategy:
matrix:
php-version: [7.1]
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: prestissimo
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
composer update --prefer-dist
- name: PHP Static Analysis Tool
run: |
composer run-script phpstan -- --no-progress
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ parameters:
ignoreErrors:
- '#^Unsafe usage of new static\(\)\.$#'
# PHP 7.1 only
- '#^Constant JSON_THROW_ON_ERROR not found\.$#'
- '#^Caught class JsonException not found\.$#'
- '#^Call to method getCode\(\) on an unknown class JsonException\.$#'

0 comments on commit 286e436

Please sign in to comment.