57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
branches: ["**"]
|
|
|
|
jobs:
|
|
build:
|
|
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 }}
|
|
extensions: mbstring, intl, json
|
|
tools: composer:v2
|
|
coverage: none
|
|
|
|
- name: Validate composer.json
|
|
run: composer validate --no-check-publish --strict
|
|
|
|
- name: Get composer cache directory
|
|
id: composer-cache
|
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache composer
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-composer-
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: PHP CS Fixer (dry-run)
|
|
run: vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --verbose src
|
|
|
|
- name: PHPStan
|
|
run: vendor/bin/phpstan analyse --no-progress --memory-limit=1G
|
|
|
|
- name: Codeception (if configured)
|
|
if: hashFiles('**/codeception.yml') != ''
|
|
run: vendor/bin/codecept run --verbosity 1
|