chore: add FUNDING.yml (GitHub Sponsors button) #5
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: [ '**' ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: "Tests — PHP ${{ matrix.php }} (${{ matrix.dependencies }} deps)" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ '8.1', '8.2', '8.3', '8.4' ] | |
| dependencies: [ 'highest' ] | |
| include: | |
| - php: '8.1' | |
| dependencies: 'lowest' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, json, fileinfo | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Validate composer.json | |
| run: composer validate --strict | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v3 | |
| with: | |
| dependency-versions: ${{ matrix.dependencies }} | |
| - name: Run PHPUnit | |
| run: composer test | |
| static-analysis: | |
| name: Static analysis (PHPStan) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Run PHPStan | |
| run: composer phpstan | |
| coding-standards: | |
| name: Coding standards (PHP-CS-Fixer) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Run PHP-CS-Fixer | |
| env: | |
| PHP_CS_FIXER_IGNORE_ENV: 1 | |
| run: composer cs:check | |
| coverage: | |
| name: Coverage (line floor 88%) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| extensions: mbstring, json, fileinfo | |
| coverage: pcov | |
| tools: composer:v2 | |
| - name: Install dependencies | |
| uses: ramsey/composer-install@v3 | |
| - name: Run tests with coverage and enforce the floor | |
| run: composer coverage:check |