Additional test cases #283
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, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| matrix: | |
| php: ['8.0', '8.1', '8.3', '8.4', '8.5'] | |
| include: | |
| - php: '8.2' | |
| coverage: 'true' | |
| name: PHP ${{ matrix.php }} tests | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring | |
| coverage: ${{ matrix.coverage && 'xdebug' || 'none' }} | |
| - name: Install dependencies | |
| run: composer update --no-interaction | |
| # Run tests WITHOUT coverage on non-coverage matrix jobs | |
| - name: Execute tests | |
| if: ${{ !matrix.coverage }} | |
| run: ./vendor/bin/phpunit --testdox | |
| # Run tests WITH Clover coverage for the coverage job | |
| - name: Execute tests with coverage (Clover) | |
| if: ${{ matrix.coverage }} | |
| env: | |
| XDEBUG_MODE: coverage | |
| run: ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox | |
| - name: Upload coverage to Qlty | |
| if: ${{ matrix.coverage }} | |
| uses: qltysh/qlty-action/coverage@v2 | |
| with: | |
| oidc: true | |
| files: build/logs/clover.xml | |
| - name: Upload the reports to coveralls.io | |
| if: ${{ matrix.coverage }} | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| file: build/logs/clover.xml | |
| format: clover | |
| flag-name: Unit | |
| allow-empty: false |