mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-13 12:02:54 +02:00
- .github/workflows/ci.yml: new `phpstan` job (PHP 8.3, no Composer) running `make phpstan` on every push/PR. - phpstan.dist.neon: include phpstan-baseline.neon so the gate is green on the ~446 pre-existing (mostly false-positive/cosmetic) findings and fails only on NEW issues. Shrink the baseline over time via `make phpstan-baseline`.
81 lines
1.9 KiB
YAML
81 lines
1.9 KiB
YAML
name: CI
|
|
|
|
# Quality gate: runs on every push and pull request.
|
|
# The project has no Composer — tests run via the committed PHAR
|
|
# (tools/.bin/phpunit.phar) and a custom autoloader (src/autoload.php).
|
|
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
name: PHP Syntax Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
coverage: none
|
|
|
|
- name: Check syntax
|
|
run: bash tools/php_syntax_check.sh
|
|
|
|
phpstan:
|
|
name: PHPStan (static analysis)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
# Matches phpVersion (80300) the analysis targets.
|
|
php-version: '8.3'
|
|
coverage: none
|
|
|
|
# Downloads the pinned PHPStan PHAR (no Composer) and analyses against the
|
|
# committed baseline — fails only on NEW issues introduced by the change.
|
|
- name: Run PHPStan
|
|
run: make phpstan
|
|
|
|
test:
|
|
name: PHPUnit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
coverage: pcov
|
|
|
|
- name: Run unit tests
|
|
run: php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist
|
|
|
|
- name: Coverage report
|
|
run: |
|
|
php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist \
|
|
--coverage-text \
|
|
--coverage-clover coverage.xml
|
|
continue-on-error: true
|
|
|
|
- name: Upload coverage artifact
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: coverage
|
|
path: coverage.xml
|
|
if-no-files-found: ignore
|