Consolidates the `peptide` CPT under PR Core ownership, dropping the `pr_peptide` slug-collision that was 404ing all 89 peptide detail pages. - POST_TYPE: pr_peptide -> peptide - TAX_CATEGORY: pr_peptide_category -> peptide_category - TAX_FAMILY + pr_peptide_family taxonomy removed - Defensive post_type_exists/taxonomy_exists guards on both registrations - Args harmonized as superset of PSA + prior PR Core (adds thumbnail support) - Activation hook + init:999 version-change flush handler - Uninstall scoped to _pr_core_authored flag (PSA-authored posts survive) - Plugin version 0.1.1 -> 0.2.0, CHANGELOG in same commit - ARCHITECTURE.md + CONVENTIONS.md updated with CPT ownership rule QA gate verdict: PASS (qa-reviews/peptide-repo-core/2026-04-22-874f93b.md) Sibling release: peptiderepo/peptide-search-ai#15 (PSA v4.5.0) Known follow-up: manage_peptide_content capability is not granted to any role as of v0.2.0. No current UI/theme reads or writes PR Core-defined meta keys, so no regression. Follow-up thread to decide role assignment.
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
name: CI
|
|
|
|
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: [ '8.1', '8.2', '8.3' ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP ${{ matrix.php }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Syntax check all PHP files
|
|
run: find . -name "*.php" -not -path "./vendor/*" | xargs -n 1 php -l
|
|
|
|
- name: Unit tests (lightweight, no PHPUnit)
|
|
run: |
|
|
for test in tests/unit/test-*.php; do
|
|
echo "=== Running $test ==="
|
|
php "$test"
|
|
done
|
|
|
|
# ── WordPress Coding Standards (PHP CodeSniffer) ──────────────────
|
|
lint-phpcs:
|
|
name: WordPress Coding Standards
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Run PHPCS
|
|
run: composer run lint
|
|
continue-on-error: true
|
|
|
|
# ── 300-line file check ──────────────────────────────────────────
|
|
file-size:
|
|
name: 300-line file check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check no PHP file exceeds 300 lines
|
|
run: |
|
|
violations=0
|
|
while IFS= read -r file; do
|
|
lines=$(wc -l < "$file")
|
|
if [ "$lines" -gt 300 ]; then
|
|
echo "VIOLATION: $file ($lines lines)"
|
|
violations=$((violations + 1))
|
|
fi
|
|
done < <(find . -name "*.php" -not -path "./vendor/*" -not -path "./tests/*")
|
|
if [ "$violations" -gt 0 ]; then
|
|
echo "$violations file(s) exceed 300 lines"
|
|
exit 1
|
|
fi
|
|
echo "All PHP files are 300 lines or fewer."
|