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: Lint & Code Quality | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| jobs: | |
| lint: | |
| name: PHP Lint & Code Style Check | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: ['8.3'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: mbstring, bcmath, intl, json | |
| ini-values: post_max_size=256M, upload_max_filesize=256M | |
| tools: composer:v2 | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Check PHP syntax | |
| run: find app -name "*.php" -exec php -l {} \; | |
| continue-on-error: true | |
| - name: Run Laravel Pint (Code Style Checker) | |
| run: ./vendor/bin/pint --test | |
| continue-on-error: true | |
| - name: Run PHP_CodeSniffer | |
| run: ./vendor/bin/phpcs app --standard=PSR12 | |
| continue-on-error: true | |
| - name: Check Laravel Query Optimization | |
| run: | | |
| echo "✅ Linting complete!" | |