Merge pull request #390 from pedro-mendonca/dependabot/composer/gette… #494
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: Static Analysis | |
on: | |
push: | |
branches: [ master, dev ] | |
pull_request: | |
branches: [ master, dev ] | |
paths: | |
# Any change to a PHP file should run checks. | |
- '**.php' | |
# These files configure Composer. Changes could affect the outcome. | |
- 'composer.*' | |
# This file configures PHPStan. Changes could affect the outcome. | |
- 'phpstan.neon' | |
# Changes to workflow files should always verify all workflows are successful. | |
- '.github/workflows/*.yml' | |
# Allows you to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
jobs: | |
# Runs PHPStan Static Analysis. | |
# | |
# Violations are reported inline with annotations. | |
# | |
# Performs the following steps: | |
# - Checks out the repository. | |
# - Sets up PHP. | |
# - Logs debug information. | |
# - Installs Composer dependencies (use cache if possible). | |
# - Runs PHPStan on the full codebase. | |
phpstan: | |
name: Static Analysis (PHP ${{ matrix.php-versions }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['7.4', '8.0', '8.1', '8.2'] # 7.4 is the minimum supported version. | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: none | |
env: | |
fail-fast: false | |
- name: Log debug information | |
run: | | |
php --version | |
composer --version | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Run PHPStan static analysis (PHP ${{ matrix.php-versions }}) | |
run: composer lint:phpstan |