Skip to content

feat: improve nullable detection and code structure #28

feat: improve nullable detection and code structure

feat: improve nullable detection and code structure #28

Workflow file for this run

name: PHP CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.4]
steps:
- uses: actions/checkout@v4
# Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
extensions: mbstring, json, pdo, pdo_sqlite, sqlite3, xdebug
# Validate composer.json and composer.lock
- name: Validate composer.json and composer.lock
run: composer validate --strict
# Cache Composer dependencies
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
# Create var/cache folder for PHP-CS-Fixer (optional if using cache)
- name: Create cache folder
run: mkdir -p var/cache
# Install dependencies
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
# PHPUnit
- name: Run PHPUnit tests with coverage
run: XDEBUG_MODE=coverage vendor/bin/phpunit
# PHPCS
- name: Check coding standards
run: vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no
# PHPStan
- name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon --level 1
# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
with:
files: var/clover.xml
fail_ci_if_error: true