name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
stability: [prefer-lowest, prefer-stable]
exclude:
- php: '8.4'
stability: prefer-lowest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, json
coverage: pcov
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Run tests
run: ./vendor/bin/phpunit --coverage-text
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: intl, json
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-interaction
- name: PHPStan
run: ./vendor/bin/phpstan analyse --no-progress
- name: PHP CS Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff
|