bc4fad3b86
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 10s
Tests / Unit Tests (push) Successful in 13s
Tests / Integration Tests (push) Successful in 35s
Tests / PHP Lint (push) Successful in 9s
Tests / PHPCS (push) Successful in 24s
Tests / PHPStan (push) Successful in 26s
package-plugin.sh 依 SLUG 解析到 wp-content/plugins 下的固定路徑,打包的是 線上工作副本而非 CI 的 checkout,且會在該目錄跑 composer install --no-dev → 每次 push 都會把開發機的 vendor/bin 清掉(本 session 中發生兩次)。 - anti-eav-lint.yml:移除 packaging 步驟,只保留 lint - ci-package.sh:委派共用腳本後補跑 composer install 還原 dev 依賴 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
name: Anti-EAV Lint + Quality Gate
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master, develop]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
anti-eav-lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Composer install (no-dev)
|
|
run: |
|
|
if [ -f composer.json ]; then
|
|
composer install --no-dev --optimize-autoloader --no-interaction
|
|
fi
|
|
|
|
- name: PHP syntax lint
|
|
run: |
|
|
set -e
|
|
FAILED=$(find . -name '*.php' \
|
|
-not -path './vendor/*' \
|
|
-not -path './node_modules/*' \
|
|
-not -path './e2e/*' \
|
|
-not -path './tests/*' \
|
|
-exec php -l {} \; 2>&1 | grep -v 'No syntax errors' || true)
|
|
if [ -n "$FAILED" ]; then
|
|
echo "PHP syntax errors detected:"
|
|
echo "$FAILED"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Anti-EAV strict lint
|
|
run: |
|
|
if ! command -v wp >/dev/null 2>&1; then
|
|
echo "wp-cli not available; skipping anti-eav lint"
|
|
exit 0
|
|
fi
|
|
# dev30 hosts the plugin family this repo belongs to.
|
|
TMDO_HOST="/var/www/Studio/wp-local-dev30"
|
|
if [ -d "$TMDO_HOST" ]; then
|
|
wp --path="$TMDO_HOST" tmdo lint --plugin="${GITHUB_WORKSPACE}" --strict
|
|
else
|
|
echo "TMDO_HOST not found; skipping anti-eav lint"
|
|
fi
|
|
|
|
# NOTE: no packaging audit here on purpose.
|
|
# The shared package-plugin.sh resolves the plugin by SLUG to a fixed path
|
|
# under wp-content/plugins — it does NOT package the CI checkout. Running it
|
|
# from a job therefore rebuilds (and `composer install --no-dev`s) the live
|
|
# working copy, wiping the developer's vendor/bin. Packaging belongs to the
|
|
# release workflow / a manual run, not to every push.
|