Skip to content

php.yml: Test on PHP 8.x (#53) #38

php.yml: Test on PHP 8.x (#53)

php.yml: Test on PHP 8.x (#53) #38

Workflow file for this run

name: PHP Composer
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Composer validate
run: composer validate
- name: Cache Composer cache
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-cache-php${{ matrix.php }}
- name: Composer install
run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader
- name: Run test suite
run: composer test
- name: Setup PHP for coverage
if: matrix.php == '7.4'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- name: Generate coverage
if: matrix.php == '7.4'
run: vendor/bin/phpunit --coverage-clover coverage.clover
- name: Upload Scrutinizer coverage
if: matrix.php == '7.4'
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover coverage.clover"