From 8436004ce62257959f621adba88c59a5fb420c1a Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 12 Feb 2026 15:14:03 +0100 Subject: [PATCH] qual: Update PHPStan workflow to run on all files in integration (#37207) The PHPStan workflow has been updated to run on all files in integration branches. --- .github/workflows/phpstan.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 2b1055d10ff..fc45458b051 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -89,16 +89,28 @@ jobs: # Run PHPStan - name: Run PHPStan id: phpstan - if: "! cancelled() && steps.changed-php.outputs.any_changed == 'true'" + # Proceed when: + # - the action is not cancelled + # AND + # - the branch is an integration branch (no merge), or, + # - the merge from branch contains 'phpstan_full', or, + # - there are changes in PHP files. + if: ${{ ! cancelled() && (github.ref_name == 'develop' || github.ref_name == 'refs/heads/develop' || endsWith(github.ref_name, '.0') || contains(github.head_ref, 'phpstan_full') || steps.changed-php.outputs.any_changed == 'true') }} env: ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }} # shellcheck disable=2086 run: | # shellcheck disable=2086 > /tmp/phpstan-files.txt - echo "$ALL_CHANGED_FILES" >> /tmp/phpstan-files.txt - cat /tmp/phpstan-files.txt - phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php ${ALL_CHANGED_FILES} | tee _stan.xml | cs2pr --graceful-warnings + if [ "${{ github.ref_name }}" == "develop" ] || [[ "${{ github.ref_name }}" == *.0 ]]|| [[ "${{ github.head_ref }}" == *"phpstan_full"* ]] ; then + # Run on all files in integration branch + phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings + + else + echo "$ALL_CHANGED_FILES" >> /tmp/phpstan-files.txt + cat /tmp/phpstan-files.txt + phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php ${ALL_CHANGED_FILES} | tee _stan.xml | cs2pr --graceful-warnings + fi # continue-on-error: true # Save cache