Fix #223
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| phpstan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| tools: composer, phpstan | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Run PHPStan | |
| run: composer run phpstan | |
| phpunit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| tools: composer, phpunit | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Run PHPUnit | |
| run: composer run phpunit | |
| rector: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| tools: composer | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Run Rector (dry-run) | |
| run: composer run rector:ci | |
| - name: Check for Rector changes | |
| id: rector_changes | |
| if: failure() | |
| run: | | |
| composer run rector:fix | |
| git diff --exit-code || echo "rector_changes=true" >> $GITHUB_OUTPUT | |
| - name: Upload Rector diff artifact | |
| if: steps.rector_changes.outputs.rector_changes == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rector-diff-${{ github.sha }} | |
| path: | | |
| **/*.php | |
| !vendor/** |