77b4501682
.gitea/workflows/ - test.yml:unit / integration / lint / phpcs,外加 A 從未有過的 phpstan job。 env 改 TMDO_TEST_DB_*(bootstrap 仍相容 WPDO_TEST_DB_*),host-mode runner 直連本機 MariaDB,保留 A v3.4.6 的 DB preflight(區分 INFRA 失敗與測試失敗) - anti-eav-lint.yml:TMDO_HOST 指向 dev30、改用 wp tmdo lint、slug 換成 2meet-data-optimizer - release.yml:v* tag 觸發,test-gate 加跑 phpstan scripts/ci-package.sh 依專案規範委派給共用的 scripts/package-plugin.sh(10 項終檢、統一排除清單、 輸出 wp-local-dev/dist/),而不是自帶一份排除邏輯;找不到共用腳本時才走 最小 fallback 並明確警告該路徑跳過終檢。 實測:bash scripts/ci-package.sh → 10 項終檢全 PASS (552 KB / 185 entries、schema drift 34 CREATE vs 34 DROP 對齊) 註:B 目前沒有 git remote,workflow 檔案就緒但要推上 gitea 才會實際執行。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
67 lines
2.0 KiB
YAML
67 lines
2.0 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
|
|
|
|
- name: Packaging audit (10-check)
|
|
run: |
|
|
# package-plugin.sh lives in the wp-local-dev tree and is shared by all
|
|
# custom plugins; its output goes to wp-local-dev/dist/.
|
|
PACKAGING_HOST="/var/www/Studio/wp-local-dev"
|
|
if [ -d "$PACKAGING_HOST" ]; then
|
|
SLUG="2meet-data-optimizer"
|
|
bash "$PACKAGING_HOST/scripts/package-plugin.sh" "$SLUG"
|
|
else
|
|
echo "PACKAGING_HOST not found; skipping packaging audit"
|
|
fi
|