Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Code Lint

on:
push:

jobs:
php-cs-fixer:
name: PHP CS Fixer
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl
coverage: none
tools: php-cs-fixer

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-dev

- name: Cache PHP CS Fixer
uses: actions/cache@v4
with:
path: .php-cs-fixer.cache
key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('.php-cs-fixer.dist.php') }}
restore-keys: |
${{ runner.os }}-php-cs-fixer-

- name: Run PHP CS Fixer (dry-run)
shell: /usr/bin/bash -e {0}
env:
COMPOSER_PROCESS_TIMEOUT: 0
COMPOSER_NO_INTERACTION: 1
COMPOSER_NO_AUDIT: 1
run: php-cs-fixer fix --dry-run --diff --verbose --config=.php-cs-fixer.dist.php

- name: Upload PHP CS Fixer results
if: failure()
uses: actions/upload-artifact@v4
with:
name: php-cs-fixer-results
path: .php-cs-fixer.cache
59 changes: 59 additions & 0 deletions .github/workflows/code-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Code Validation

on:
push:

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest

strategy:
matrix:
php-version: ['7.4','8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: none
tools: phpstan

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Cache PHPStan results
uses: actions/cache@v4
with:
path: /tmp/phpstan
key: ${{ runner.os }}-phpstan-${{ matrix.php-version }}-${{ hashFiles('phpstan.neon*') }}-${{ hashFiles('**/*.php') }}
restore-keys: |
${{ runner.os }}-phpstan-${{ matrix.php-version }}-${{ hashFiles('phpstan.neon*') }}-
${{ runner.os }}-phpstan-${{ matrix.php-version }}-

- name: Run PHPStan
run: vendor/bin/phpstan analyse --memory-limit=1G

- name: Upload PHPStan results
if: failure()
uses: actions/upload-artifact@v4
with:
name: phpstan-results-php-${{ matrix.php-version }}
path: |
phpstan-report.json
/tmp/phpstan