Update reusable flow #1
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: '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 }} |