55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
|
|
jobs:
|
|
test:
|
|
name: PHP ${{ matrix.php }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php: [ '8.1', '8.2', '8.3' ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
coverage: none
|
|
tools: composer:v2
|
|
|
|
- name: Get Composer Cache Directory
|
|
id: composer-cache
|
|
run: |
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: ${{ runner.os }}-composer-
|
|
|
|
- name: Validate composer.json
|
|
run: composer validate --strict
|
|
|
|
- name: Install dependencies (libraries use update)
|
|
run: composer update --no-interaction --no-progress --prefer-dist
|
|
|
|
- name: Static Analysis (PHPStan)
|
|
run: vendor/bin/phpstan analyse
|
|
|
|
- name: Coding Standards (PHP-CS-Fixer dry run)
|
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
- name: PHPUnit
|
|
run: vendor/bin/phpunit -c phpunit.xml.dist
|