Skip to content

add namespace autoloader #60

add namespace autoloader

add namespace autoloader #60

Workflow file for this run

name: PHPStan
on:
push:
branches: [ alpha ]
pull_request:
branches: [ alpha ]
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 7.4 for dependencies
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Install Dependencies
run: composer update --ignore-platform-reqs
- name: Setup PHP 8.2 for PHPStan
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Restore PHPStan cache
id: cache-phpstan
uses: actions/cache/restore@v3
with:
path: phpstan.phar
key: phpstan-1
- name: Download PHPStan
if: steps.cache-phpstan.outputs.cache-hit != 'true'
run: wget https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
- name: Run PHPStan
run: php phpstan.phar analyse --configuration phpstan.neon
update-baseline:
needs: phpstan
if: github.event_name == 'push' && github.ref == 'refs/heads/alpha'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Delete existing branch if exists
run: |
if git ls-remote --heads origin update-phpstan-baseline | grep update-phpstan-baseline; then
git push origin --delete update-phpstan-baseline
fi
- name: Setup PHP 7.4 for dependencies
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Install Dependencies
run: composer update --ignore-platform-reqs
- name: Setup PHP 8.2 for PHPStan
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Download PHPStan
run: wget https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
- name: Generate new baseline
id: generate-baseline
run: |
cp phpstan-baseline.neon phpstan-baseline.neon.old
php phpstan.phar analyse --configuration phpstan.neon --generate-baseline
if ! diff -q phpstan-baseline.neon phpstan-baseline.neon.old > /dev/null; then
echo "baseline_changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.generate-baseline.outputs.baseline_changed == 'true'
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update PHPStan baseline
title: '[CI] Update PHPStan baseline'
body: |
Mise à jour automatique du baseline PHPStan suite à la correction d'erreurs.
Cette PR a été générée automatiquement par le workflow CI/CD.
branch: update-phpstan-baseline
base: alpha
delete-branch: true
add-paths: |
phpstan-baseline.neon
reviewers: |
zoic21
Hotfirenet
tmartinez69009
Salvialf
Sekiro-kost
reineabs