Skip to content

Update reusable flow #1

Update reusable flow

Update reusable flow #1

Workflow file for this run

name: 'PHP Static Analysis'
jobs:
phpstan:
strategy:
matrix:
phpVersion: [
"7.4",
"8.0",
"8.1",
"8.2",
"8.3"
]
runs-on: ubuntu-20.04
steps:
# ------------------------------------------------------------------------------
# Checkout the repository
# ------------------------------------------------------------------------------
- name: Checkout the repository
uses: actions/checkout@v4
# ------------------------------------------------------------------------------
# Get the changed files in a space separated list.
# ------------------------------------------------------------------------------
- name: Get all changed files and use a space separator in the output
id: changed-files
uses: tj-actions/changed-files@v44
with:
separator: " "
# ------------------------------------------------------------------------------
# Set up PHP and run phpstan
# ------------------------------------------------------------------------------
- name: Configure PHP environment to run phpstan
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.phpVersion }}
# ------------------------------------------------------------------------------
# Override composer php version
# ------------------------------------------------------------------------------
- name: Set php version ${{ matrix.phpVersion }} in composer
run: composer config platform.php ${{ matrix.phpVersion }}
# ------------------------------------------------------------------------------
# Install dependencies - ignoring php requirements
# ------------------------------------------------------------------------------
- name: Install dependencies
run: composer i --ignore-platform-req=php+
# ------------------------------------------------------------------------------
# Run phpstan
# ------------------------------------------------------------------------------
- name: Run phpstan
run: ./vendor/bin/phpstan analyse --error-format=table -c phpstan.neon ${{ steps.changed-files.outputs.all_changed_files }}