The deploy workflow references CI via `uses: ./.github/workflows/ci.yml` which requires the CI workflow to have an `on: workflow_call` trigger. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
92 lines
2.7 KiB
YAML
92 lines
2.7 KiB
YAML
name: CI — Lint & Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
# ── PHP Syntax Check ─────────────────────────────────────────────
|
|
lint-php:
|
|
name: PHP Lint (${{ matrix.php }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: ['7.4', '8.1', '8.3']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP ${{ matrix.php }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer
|
|
|
|
- name: Syntax check all PHP files
|
|
run: find . -name '*.php' -not -path './vendor/*' -not -path './peptide-news-plugin/*' -print0 | xargs -0 -n1 php -l
|
|
|
|
# ── PHPCS Coding Standards ───────────────────────────────────────
|
|
phpcs:
|
|
name: PHPCS
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
tools: composer
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run PHPCS
|
|
run: vendor/bin/phpcs --standard=.phpcs.xml.dist
|
|
|
|
# ── PHPUnit Tests ────────────────────────────────────────────────
|
|
phpunit:
|
|
name: PHPUnit (${{ matrix.php }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: ['7.4', '8.1', '8.3']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP ${{ matrix.php }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer
|
|
coverage: xdebug
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run PHPUnit
|
|
run: vendor/bin/phpunit --testdox
|
|
|
|
# ── JavaScript Lint ──────────────────────────────────────────────
|
|
lint-js:
|
|
name: JS Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Check JS syntax
|
|
run: |
|
|
for f in $(find . -name '*.js' -not -path './vendor/*' -not -path './node_modules/*' -not -path './peptide-news-plugin/*'); do
|
|
node --check "$f" || exit 1
|
|
done
|