Repo polish: badges, bilingual README, examples, community files, CI hardening #4
Workflow file for this run
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, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: PHP ${{ matrix.php }} | |
| continue-on-error: ${{ matrix.experimental }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.0', '8.1', '8.2', '8.3'] | |
| experimental: [false] | |
| include: | |
| - php: '8.4' | |
| experimental: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: json, mbstring | |
| coverage: ${{ matrix.php == '8.3' && 'pcov' || 'none' }} | |
| - name: Get Composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| if: matrix.php != '8.0' | |
| run: composer install --no-interaction --prefer-dist | |
| # composer.lock PHP >=8.1 ile üretilmiştir; PHP 8.0 için uyumlu set taze çözülür | |
| - name: Install dependencies (resolve fresh for PHP 8.0) | |
| if: matrix.php == '8.0' | |
| run: composer update --no-interaction --prefer-dist --no-progress | |
| - name: Validate Composer | |
| run: composer validate --strict | |
| - name: Run PHPUnit | |
| if: matrix.php != '8.3' | |
| run: composer test | |
| - name: Run PHPUnit (with coverage) | |
| if: matrix.php == '8.3' | |
| run: vendor/bin/phpunit --coverage-clover=coverage.xml | |
| - name: Upload coverage to Codecov | |
| if: matrix.php == '8.3' && github.event_name == 'push' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false |