This commit is contained in:
Laurent Destailleur
2026-01-19 16:05:31 +01:00
parent b46b8b4476
commit 0fb5a9b3e9
2 changed files with 15 additions and 3 deletions

View File

@@ -34,12 +34,23 @@ jobs:
|| github.event.schedule == false
steps:
- uses: actions/checkout@v6
# Another method to get the list of changed files
# It sets the variable steps.changed-php.outputs.all_changed_files for other steps
- name: Get all changed php files (if PR)
id: changed-php
if: env.gh_event == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/scripts/get_changed_php.sh
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none # disable xdebug, pcov
tools: phan
- name: Get changed PHP files
id: files
run: |
@@ -47,6 +58,7 @@ jobs:
FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.php$' || true)
PHP_FILES=$(echo "$FILES" | grep '\.php$' || true)
echo "$PHP_FILES" > /tmp/phan-files.txt
- name: Run Phan analysis
if: steps.files.outputs.files != ''
run: |

View File

@@ -109,15 +109,15 @@ jobs:
tools: phpcs
# Install perltidy and perlcritic
- name: Install perltidy and perlcritic
run: sudo apt-get update && sudo apt-get install -y perltidy libperl-critic-perl
#- name: Install perltidy and perlcritic
# run: sudo apt-get update && sudo apt-get install -y perltidy libperl-critic-perl
# Run all the precommit tools (defined into pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
env:
# SKIP is used by pre-commit to not execute certain hooks
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer,shellcheck
run: |
set -o pipefail
pre-commit gc