composer update #9
This file contains hidden or 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: Estilo y Analisis estatico de archivos PHP modificados | |
| on: | |
| pull_request: | |
| branches: [ develop, main ] | |
| workflow_dispatch: | |
| jobs: | |
| style_static: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Cache Composer | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.composer/cache | |
| vendor | |
| key: ${{ runner.os }}-php82-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php82-composer- | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist --no-progress | |
| # ------- Detectar archivos PHP modificados ------- | |
| - name: Detectar archivos PHP modificados | |
| id: changed | |
| run: | | |
| git fetch origin ${{ github.base_ref }} --depth=1 | |
| git diff --name-only origin/${{ github.base_ref }}...HEAD > all_changed.txt | |
| grep -E '\.php$' all_changed.txt > changed_php.txt || true | |
| echo "Changed PHP files:" | |
| cat changed_php.txt || true | |
| # ------- Ejecutar Pint ------- | |
| - name: Ejecutar Laravel Pint en archivos modificados | |
| run: | | |
| if [ -s changed_php.txt ]; then | |
| xargs -a changed_php.txt vendor/bin/pint --test | |
| else | |
| echo "No PHP files changed; skipping Pint." | |
| fi | |
| # ------- Ejecutar PHPStan ------- | |
| - name: Ejecutar PHPStan en archivos modificados | |
| run: | | |
| PHPSTAN_ARGS="--error-format=github" | |
| if [ -s changed_php.txt ]; then | |
| echo "Running PHPStan on changed PHP files..." | |
| xargs -a changed_php.txt vendor/bin/phpstan analyse $PHPSTAN_ARGS | |
| else | |
| echo "No PHP files changed; skipping PHPStan." | |
| fi |