Updated version number. #407
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: run-phpstan | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: [ 'master', 'main' ] | |
jobs: | |
run: | |
name: Run PHPStan | |
runs-on: 'ubuntu-latest' | |
strategy: | |
matrix: | |
level: [ 1, 2 ] | |
include: | |
- current-level: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 | |
- name: Install PHPStan | |
run: composer require --dev phpstan/phpstan | |
- name: Run PHPStan | |
if: matrix.level == matrix.current-level | |
run: ./vendor/bin/phpstan analyse -c spec/phpstan.neon --memory-limit 1024M src spec/INTER-Mediator-UnitTest --level "${{ matrix.level }}" | |
- name: Run PHPStan | |
if: matrix.level > matrix.current-level && github.event_name != 'pull_request' | |
continue-on-error: true | |
run: | | |
./vendor/bin/phpstan analyse -c spec/phpstan.neon --memory-limit 1024M src spec/INTER-Mediator-UnitTest --level "${{ matrix.level }}" | |
exit 0 | |
- uses: actions/checkout@v4 | |
name: checkout "${{ github.base_ref }}" | |
if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.base_ref }} | |
- uses: actions/checkout@v4 | |
name: checkout "${{ github.head_ref }}" | |
if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Run PHPStan for pull request event | |
if: matrix.level > matrix.current-level && github.event_name == 'pull_request' | |
shell: bash | |
continue-on-error: true | |
run: | | |
FILES=(`git diff origin/${{ github.base_ref }} --name-only src spec/INTER-Mediator-UnitTest | tr '\n' ' '`) | |
if [[ "$FILES" != "" ]]; then composer require --dev phpstan/phpstan; ./vendor/bin/phpstan analyse -c spec/phpstan.neon --memory-limit 1024M ${FILES} --level "${{ matrix.level }}"; fi | |
exit 0 |