Skip to content

Update tests.yml

Update tests.yml #8

Workflow file for this run

name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.4, 8.5]
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
coverage: xdebug
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Run test suite
run: composer test
- name: Run test suite with coverage
if: matrix.php == '8.4' && matrix.stability == 'prefer-stable'
run: composer test-coverage
- name: Run PHPStan
if: matrix.php == '8.4' && matrix.stability == 'prefer-stable'
run: php -d memory_limit=512M vendor/bin/phpstan analyse --error-format=github
- name: Check code style
if: matrix.php == '8.4' && matrix.stability == 'prefer-stable'
run: composer format-check