fix: resolve %kernel.default_locale% parameter reference before valid… #35
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: PHP CI | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: [8.4] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Setup PHP | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| coverage: xdebug | |
| extensions: mbstring, json, pdo, pdo_sqlite, sqlite3, xdebug | |
| # Validate composer.json and composer.lock | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| # Cache Composer dependencies | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| # Create var/cache folder for PHP-CS-Fixer | |
| - name: Create cache folder | |
| run: mkdir -p var/cache | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| # Fast checks first (fail early) | |
| # PHPCS | |
| - name: Check coding standards | |
| run: vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --ansi | |
| # PHPStan | |
| - name: Run PHPStan | |
| run: vendor/bin/phpstan analyse --memory-limit=512M --ansi | |
| # PHPUnit (slowest — runs last) | |
| - name: Run PHPUnit tests with coverage | |
| shell: bash | |
| run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --colors=always | tee var/coverage-summary.txt | |
| # Coverage threshold | |
| - name: Check coverage threshold | |
| run: | | |
| COVERAGE=$(grep -oP 'Lines:\s+\K[\d.]+' var/coverage-summary.txt | head -1) | |
| if [ -z "$COVERAGE" ]; then | |
| echo "::error::Could not parse coverage from PHPUnit output" | |
| exit 1 | |
| fi | |
| echo "Line coverage: ${COVERAGE}%" | |
| if (( $(echo "$COVERAGE < 100" | bc -l) )); then | |
| echo "::error::Coverage ${COVERAGE}% is below 100% threshold" | |
| exit 1 | |
| fi | |
| # Upload coverage to Codecov | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} | |
| with: | |
| files: var/clover.xml | |
| fail_ci_if_error: true |